For system, network and cloud administrators

How to install and use tmux

How to install and use tmux

tmux is a very useful tool when working with the terminal. It basically allows you to start multiple sessions and each one of these sessions can have multiple panes inside it. tmux is a terminal tool focused on window and session management. tmux is available for: Debian/Ubuntu, Fedora, RHEL/CentOS, Arch Linux, OpenSUSE, macOS.


Useful macOS keyboard shortcuts

ActionKeyboard keys
CopyCommand + C
PasteCommand + V
UndoCommand + Z
Open new browser tabCommand + T
Reload/refresh browser tabCommand + R
Close browser tabCommand + W
General macOS keyboard shorcuts

Inside a macOS terminal, apart from the general keyboard shortcuts (like closing or opening a new tab), I sometimes find myself in need to do things differently.


Bash completion

macOS Catalina

  1. Open your terminal and install the bash-completion package using brew:
brew install bash-completion
  1. Adjust your .bash_profile by running in your terminal:
echo "[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion" >> ~/.bash_profile
  1. Reload your .bash_profile:
source ~/.bash_profile


How to disable computer from sleeping?

Whenever I’d leave my computer open for more than 30-40 minutes without touching it, I’d always find it locked or with my VPN disconnected (which is really frustrating, especially when working remotely).

macOS

The command below will disable sleeping on your computer and it will keep it awake even if your laptop is not connected to a power source. So, open your terminal and type:

sudo pmset sleep 0