-
Notifications
You must be signed in to change notification settings - Fork 0
Using tmux to run jobs in the background
Tmux is a terminal multiplexer, allowing users to create multiple viewing panes within a single session, much like having multiple tabs open in a web browser. It's also very useful if you need to run jobs that take a long time and need to disconnect from a server and come back later.
In the simplest use, just type:
tmux
...and a new tmux session will open.
In general, to perform actions with tmux such as adding new panes, switching to panes, disconnecting from sessions, you must first press ctrl + b
. Once you press this combination of keys, you will then press a key to do the action.
Common actions:
- ctrl + b , then c = open a new pane
- ctrl + b , then n = go to the next pane
- ctrl + b , then p = go to the previous pane
- ctrl + b , then d = disconnect from your tmux session
As listed above, ctrl + b , then d
will disconnect from your session. There are ways to have multiple sessions available, but assuming you only have one, to reconnect to the last tmux session used, do the following:
tmux a