Skip to content

Instantly share code, notes, and snippets.

@ecliptik ecliptik/
Created Nov 11, 2015

What would you like to do?
Introduction to Tmux

Introduction to tmux

Show a list of tmux sessions:

  tmux ls
  desk: 3 windows (created Fri Apr  3 09:38:32 2015) [104x30]

Detach from other "desk" session and re-attach, the session will re-configure based on your environment, ie going from portrait to landscape:

  tmux attach -d -t desk

Create a new named session "laptop":

  tmux new-session -s laptop

Basic commands

Split a pane vertically:


Split a pane horizontally:


Switch panes with standard bindings:


Fullscreen a pane:


Create a new window:


Switch to next window:


Switch to previous window:


Detach from session:


Using tmux for sharing

Sharing a new session

Startup new tmux session with a shared socket:

  tmux -S /tmp/share new-session -s share

Change permissions of socket to 777:

  chmod 777 /tmp/share

Have other user log into your system and connect to shared socket:

  tmux -S /tmp/share attach -t share

Sharing an existing session

Find out the session socket in /tmp:

  ls -la /tmp | grep tmux
  drwx------  2 mwaltz users     60 Apr  3 09:38 tmux-69383

Use sudo to attach to the socket:

  sudo tmux -S /tmp/tmux-69383/default attach

Additional References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.