Chinese Yellow Pages | Classifieds | Knowledge | Tax | IME

screen tmux cheat sheet

Screen

screen -d -R your_session name

//split only the monitor screen

ctrl-a ( release the kb ), then press: | for vsplit    —> need this step : ctrl-a, c ( to create a new window, otherwise just blank screen)

ctrl-a ( release the kb ), then press: shift s:  for hsplit

ctrl-a , tab to switch window

https://tomlee.co/2011/10/gnu-screen-splitting/

  • Ctrl+a c Create a new window (with shell)
  • Ctrl+a " List all window
  • Ctrl+a 0 Switch to window 0 (by number )
  • Ctrl+a A Rename the current window
  • Ctrl+a S Split current region horizontally into two regions
  • Ctrl+a | Split current region vertically into two regions
  • Ctrl+a tab Switch the input focus to the next region
  • Ctrl+a Ctrl+a Toggle between the current and previous region
  • Ctrl+a Q Close all regions but the current one
  • Ctrl+a X Close the current region

https://linuxize.com/post/how-to-use-linux-screen/

sample config: more  ~/.screenrc
# Enable mouse scrolling and scroll bar history scrolling
termcapinfo xterm* ti@:te@

# This line makes Detach and Re-attach without losing the regions/windows layout
layout save default

 

tmux:

ctrl-b:

  • Ctrl+b " — split pane horizontally.
  • Ctrl+b % — split pane vertically.
  • Ctrl+b arrow key — switch pane.
  • Hold Ctrl+b, don’t release it and hold one of the arrow keys — resize pane.
  • Ctrl+b c — (c)reate a new window.
  • Ctrl+b n — move to the (n)ext window.
  • Ctrl+b p — move to the (p)revious window.

https://lukaszwrobel.pl/blog/tmux-tutorial-split-terminal-windows-easily/

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

 

Tmux features automatic window renaming while the Screen lacks this feature.

The Screen allows session sharing with other users while Tmux does not.

 

BASH fg, bg

run one command, e.g:  ping -i 5 www.google.com

Ctrl-Z  ( stop the current process in the bash shell )

put it into background running: bg

bring it back to foreground: fg

 

 

Please rate this


Comments are closed here.