Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells

Tmux Bootstrap Configuration

Submitted by on February 17, 2018 – 3:22 pm

Just a list of commands to quickly configure tmux with some of the best (i.e. my favorite) plugins and options. Feel free to disagree – you may be right – but I don’t think so.

The settings below are for tmux v 2+. If you’re running an older distro and for some reason can’t upgrade, you would need to figure out a way to install the newer version of tmux for your distro. Here’s an example for CentOS 6:

yum -y erase tmux
curl -s0 -k -w3 https://gist.githubusercontent.com/pokev25/4b9516d32f4021d945a140df09bf1fde/raw/1b37bad028d82180f8de306476b492cd68cc02b4/install-tmux.sh > ~/install-tmux.sh
chmod 750 ~/install-tmux.sh
~/install-tmux.sh
pkill tmux
tmux -V

Get a tmux cheatsheet and add a convenient bash alias.

curl -s0 -k  -w5 https://gist.githubusercontent.com/remarkablemark/c366603f6cf364f157a7dd67ad246f8b/raw/0013ab0e62a84215bb604a5eaad1581989bb9204/tmux-cheatsheet.md | sed 's/\^b/^a/g' > ~/.tmux-cheatsheet.md
echo "alias tmuxhelp='cat ~/.tmux-cheatsheet.md | column -s\"|\" -t'" >> ~/.bashrc
source ~/.bashrc

Get the .tmux.conf file.

curl -s0 -k -w5 https://raw.githubusercontent.com/gpakosz/.tmux/master/.tmux.conf > ~/.tmux.conf

Install tmux plugin manager and resurrect plugin

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
cat << EOF >> ~/.tmux.conf
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
run '~/.tmux/plugins/tpm/tpm'
EOF

# start tmux tmux new -s `whoami`01 
# activate plugin manager and load the resurrect plugin 
CTRL-a SHIFT-i

# save tmux session
CTRL-a CTRL-s

# restore tmux session
CTRL-a CTRL-r

 

Print Friendly, PDF & Email

Leave a Reply