Skip to main content

Just enough tmux to do what I need

Published: 2019-02-07 | Lastmod: 2019-05-08

As mentioned in Export timed query results from SQL*Plus, I have to SSH into an ubuntu box in order to run queries. Sometimes these queries take a while, so if my SSH connection times out, I’m out of luck.

Thankfully, I learned about tmux, and can now keep my SSH connection open as long as I’d like. Here are some useful tmux commands:

List sessions:

tmux ls

If no sessions exist, create one:


If sessions exist, attach to one:

tmux attach -t <session_name>

Attach to last used session:

tmux attach

Detach from a session:

tmux detach

Kill a session:

tmux kill-session -t <session_name>

Kill all sessions:

tmux kill-server