Tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.
When tmux is started it creates a new session with a single window and displays it on screen. A status line at the bottom of the screen shows information on the current session and is used to enter interactive commands.
tmux : start tmux
tmux new -s [session-name] : start tmux with session name
tmux ls : list all of tmux session
tmux a : attach to the latest tmux session
tmux a -t [session-name] : attach to tmux session-name
tmux detach : detach from tmux session
tmux kill-session -t [session-name] : kill tmux session-name
tmux kill-server : destroy all sessions and kill all processes
ctrl + b + " : split windows horizontally
ctrl + b + % : split windows vertically
ctrl + b + x : kill window
ctrl + b + [space] : toggle between layouts
ctrl + b + c : create window
ctrl + b + w : list windows
ctrl + b + n : next window
ctrl + b + p : previous window
ctrl + b + , : name window
ctrl + b + & : kill window
ctrl + b + s : display an interactive session list
ctrl + b + [arrow] : switch between tmux pane
ctrl + b + alt + [arrow] : resize tmux pane
ctrl + b + ? : show tmux shortcut
Screen is a terminal multiplexer. In other words, it means that you can start a screen session and then open any number of windows ( virtual terminals ) inside that session. Processes running in Screen will continue to run when their window is not visible even if you get disconnected.
screen : start screen
screen -S [session-name] : start screen with session name
screen -ls : list all screen session
screen -r [pid-session] : reattach to screen session
screen -d [pid-session] : deattach to screen session
ctrl + a + c : create a new window (with shell)
ctrl + a + " : list all window
ctrl + a + A : rename the current screen window