tmux is a terminal multiplexer. What does that mean? It means you can essentially start different “sessions” in the terminal and switch between them, and they continue to run in the background. It also means you can detach a session and reattach it on a different terminal, which is awesome. I use this feature all the time when I’m on a flakey internet connection and my connection keeps dropping, this allows the tasks to continue running even though the session dropped. It’s also handy for working during a commute. Take a job that takes a long time to run, I can start the session and kick off the job while in the office, disconnect, travel home, reconnect and reattach the session to see the current status and any output.

Start a new named session, called patching:

tmux new -s patching

“Ctrl-b” (or the Ctrl-a prefix) then “d” to detach.

List sessions:

tmux ls
patching: 1 windows (created Tue Feb 9 12:40:11 2016) [159x38]

Attach to the session called patching:

tmux a -t patching

Also tmux is available as a standard package on most linux distributions, so easy to install and use.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.