Overview
The Linux tmux and GNU screen commands are terminal multiplexers – in brief, these commands let a user launch and use multiple shell sessions from a single ssh session.
The screen or tmux commands also allow a user to initiate a command from one terminal, disconnect from that terminal, and then reconnect from a different location to that same terminal without having to restart the command.
Both of these programs are available on Teton. At the command prompt, simply type screen
or tmux
and hit enter.
Shortcuts:
While in a terminal window, press Ctrl-a (for screen) or Ctrl-b (for tmux) to access these shortcuts. The screen variants are presented here.
Ctrl-a + c: creates a new screen
Ctrl-a + N: (where N is equal to the number of the screen) this key command switch us to a specific screen
Ctrl-a + a: switches us to the next screen
Ctrl-a + w: view a list of screens. The unique ID of each screen, along with its name, and running process is displayed, for each individual window. The current window will be marked with an asterisk (*).
Ctrl-a + “: allows us to view the screen picker
Ctrl-a + ? - shows the shortcut key options
Ctrl-a + p and Ctrl-a + n: used to switch to the next or previous window.
Ctrl-a + k sequence will kill the current window session. We can also type 'exit' to kill the current window. If no other screen sessions are open, screen will simply exits. The 'C-a \' key sequence also accomplishes the same task.
Ctrl-a + d: detaches the from the current screen session.
Ctrl-a + r: reattach a detached screen session.