Notes to Self

Alex Sokolsky's Notes on Computers and Programming

tmux primer

Why Use Tmux?

Here is a quick way to get you started.

Establish the session on a remote server

In your terminal connect to the remote server:

ssh alex@remote-server

Start tmux:

alex@remote-server > tmux
# you've got a new prompt
# start a new lengthy process, e.g. this one-liner
alex@remote-server > START=$SECONDS; while true; do sleep 1; echo "Elapsed: $((SECONDS - START)) seconds"; done

By now a lengthy process started on the remote server.

Detach from the session on a remote server

You can now detach from the session: Ctrl-b d.

Or you can just kill your terminal.

Attach to the previously started session

In your terminal connect to the remote server:

ssh alex@remote-server

List the existing sessions:

tmux ls

Attach this terminal to the last session:

tmux at

Observe the time being calculated since the process was started.

If more than one session is available, attach to the one of your choice:

`tmux at -t _ses_`