Skip to content

Instantly share code, notes, and snippets.

@anmolgarg
Last active May 25, 2016 17:28
Show Gist options
  • Save anmolgarg/7066762cf7b2b1f0f325 to your computer and use it in GitHub Desktop.
Save anmolgarg/7066762cf7b2b1f0f325 to your computer and use it in GitHub Desktop.
# Install tmux on CentOS 6.7
# Yum Install Dependencies
sudo yum -y install gcc kernel-devel make ncurses-devel
# Download Sources for libevent 2.0.22 and Make and Install
curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar -xvzf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure --prefix=/usr/local
make
sudo make install
cd ..
rm -rf libevent-2.0.22-stable.tar.gz
# Download Sources for tmux 2.1 and Make and Install
curl -OL https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz
tar -xvzf tmux-2.1.tar.gz
cd tmux-2.1
LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" ./configure --prefix=/usr/local
make
sudo make install
cd ..
rm -rf tmux-2.1.tar.gz
# Close Your Terminal Window (flushes cached tmux executable)
# Open New Shell and Check tmux Version
tmux -V
# tmux cheatsheet - https://gist.github.com/MohamedAlaa/2961058
# run using `bash -c "$(curl -fsSL https://gist.githubusercontent.com/anmolgarg/7066762cf7b2b1f0f325/raw/install_tmux2dot1.sh)"`
@anmolgarg
Copy link
Author

anmolgarg commented Nov 20, 2015

tmux shortcuts & cheatsheet

from host

start new:

tmux

start new with session name:

tmux new -s myname

attach:

tmux a  #  (or at, or attach)

attach to named:

tmux a -t myname

list sessions:

tmux ls

kill session:

tmux kill-session -t myname

kill all sessions:

tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill

in session

detach from session without killing:

Ctrl+b, d

exit from session with kill:

Ctrl+d

scroll through session:

Ctrl+b, [ #then normal arrow up, arrow down

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment