2010年5月20日 星期四

Screen 命令使用

screen使用

使用screen非常簡易.只需在SHELL鍵入screen,便可打開一個screen session。
而在每個screen session 下,所有命令都以 ctrl+a(C-a) 開始。
現在讓我來簡單介紹基本的命令
C-a c -> Create == 開啟新的 window
C-a n -> Next == 切換到下個 window
C-a p -> Previous == 前一個 window
C-a C-a -> Other == 在兩個 window 間切換
C-a w -> Windows == 列出已開啟的 windows 有那些
C-a 0 -> 切換到第 0 個 window
C-a 1..9 -> 切換到第 1..9 個window
C-a a -> 發出 C-a,在 emacs, ve, bash, tcsh 下可移到行首
C-a t -> Time,顯示當前時間,和系統的 load
C-a K(大寫) -> kill window,強行關閉當前的 window
C-a [ -> 進入 copy mode,在 copy mode 下可以回滾、搜索、複製就像用使用 vi 一樣
C-b Backward,PageUp
C-f Forward,PageDown
H(大寫) High,將游標移至左上角
L Low,將游標移至左下角
0 移到行首
$ 行末
w forward one word,以字為單位往前移
b backward one word,以字為單位往後移
Space 第一次按為標記區起點,第二次按為終點
Esc 結束 copy mode

C-a ] -> Paste,把剛剛在 copy mode 選定的內容貼上
C-a ? -> Help,顯示簡單說明
C-a d -> detach,將目前的 screen session (可能含有多個 windows)
丟到後臺執行當按了 C-a d 把 screen session detach 掉後,會回到還沒進 screen 時的狀態,此時在 screen session 裏每個 window 內運行的 process (無論是前臺/後臺)都在繼續執行,即使 logout 也不影響。下次 login 進來時:screen -ls -> 顯示所有的 screen sessions
screen -r [keyword] -> 選擇一個screen session 恢復對話若 screen -ls 裏有 Attached sessions:
screen -d [keyword] -> 強制 detach,以便「接手」過來


KeyActionNotes
Ctrl+a cnew window 
Ctrl+a nnext window 
Ctrl+a pprevious window 
Ctrl+a “select window from list 
Ctrl+a Ctrl+aprevious window viewed 
Ctrl+a Ssplit terminal horizontally into regionsCtrl+a c to create new window there
Ctrl+a |split terminal vertically into regionsRequires debian/ubuntu patched screen 4.0
Ctrl+a :resizeresize region 
Ctrl+a :fitfit screen size to new terminal sizeCtrl+a F is the same. Do after resizing xterm
Ctrl+a :removeremove regionCtrl+a X is the same
Ctrl+a tabMove to next region 
Ctrl+a ddetach screen from terminalStart screen with -r option to reattach
Ctrl+a Aset window title 
Ctrl+a xlock sessionEnter user password to unlock
Ctrl+a [enter scrollback/copy modeEnter to start and end copy region. Ctrl+a ] to leave this mod
Ctrl+a ]paste bufferSupports pasting between windows
Ctrl+a >write paste buffer to fileuseful for copying between screens
Ctrl+a <read paste buffer from fileuseful for pasting between screens
Ctrl+a ?show key bindings/command namesNote unbound commands only in man page
Ctrl+a :goto screen command promptup shows last command entered

iptables firewall 本身封包比對判斷流程圖

attachments/month_200611/1163488070.gif

引用:
引用:



How to repair and clone disk with ddrescue

  ddrescue  is a tool that can be used to repair and clone disks on a  Linux system . This includes hard drives, partitions, DVD discs, flas...