Linux

Install tmux with and Without Root Access

Install tmux with Root Access

sudo apt-get install tmux

*Tested on Ubuntu 18.04 LTS

Install tmux without Root Access

Download bash script from Sudhir Mitharwal 

wget https://gist.githubusercontent.com/sudkumar/6062def9d56d946b98b6a3853093ee74/raw/66f9bcc5d341e39233d763a7ecfe3402e9de0743/install_tmux_locally.sh

Execute the script and follow the instruction

chmod +x install_tmux_locally.sh
./install_tmux_locally.sh

*Tested on Ubuntu 16.04 LTS

tmux Quick Reference

Commands

Command Description
tmux Start a new tmux session
tmux ls List all running sessions
tmux attach -t 0 Connect to session named 0
tmux new -s database Create a new session named `database`
tmux rename-session -t 0 database Rename existing session from `0` to `database`

Command Keys

Keys Description
C-b % Split a pane into left and right
C-b " Split a pane into top and bottom
C-b <arrow key> Navigate to different pane
exit or Ctrl-d Close the pane
C-b c Create a new window
C-b p Go to the previous window
C-b n Go to the next window
C-b <number> Go to specific window number
C-b d Detach from the current session
C-b D Choose which session to detach
C-b z Toggle the pane fullscreen
C-b , Rename current window
C-b ? List available commands

*C-b means press and hold the Ctrl key and press b.

References

Shell Script Learning Resources