Screen

http://neophob.com/2007/04/gnu-screen-cheat-sheet/

CMD Description
screen -ls list all ( format: pid.session_name )
screen create session
screen -S session_name create session with name
screen -r session_name re-attach
screen -dr session_name de- & re- attach /* force detach and then attach, use this when previous attachment is dropped due to network failure */
screen -wipe remove dead
kill <pid> kill session
killall screen kill all
C+a , C+d detach
C+a, [ / Esc, C+u / C+d scroll half a page ref
C+a, [ / Esc, Page Up /Down scroll a full page (cursor up/down is moving the cursor)
NA switch session //can NOT find a good method

screen windows (tabs)

  • C+a , c create new window
  • C+a , A set window name
  • C+a , w window list
  • C+a , " choose window
  • C+a , d detach window
  • C+a , ? help
  • C+a , [ copy: move cursor & press ENTER, move & select, ENTER to copy to buffer
  • C+a , ] paste from buffer
  • C+a , n window next
  • C+a , p window previous
  • C+a , 2 switch to window no. 2
  • C+a , C+a switch to the window that you just left

Tmux

https://gist.github.com/MohamedAlaa/2961058

CMD Description
tmux ls list all ( session_name is the one before colon : symbol, the first string part of each line )
tmux new -s session_name create
tmux a -t session_name re-attach
tmux kill-session -t session_name kill session
tmux kill-server Kill all
<mouse wheel> scroll
C+b , [ , page_up/_down scroll (q to exit)
C+u / C+d scroll (need .tmux.conf)
C+b , d detach
C+b , s switch session: // 's' for 'session' or 'switch' ?

tmux windows (tabs)

  • c create window
  • w windows list
  • n next window
  • p previous window
  • f find window
  • , name window
  • & kill window