Saturday, March 14, 2015

The invaluable tmux command.

tmux - Is a command that most linux vets especially those that work on remote servers probably know about, but somehow is one that I had missed. The thing that makes the command invaluable is that it allows you to run multiple command prompts from one ssh connection and then return to those prompts after you disconnect or worse when a connection drops. tmux is a pretty deep tool with panes, windows, and sessions allowing you to juggle command prompts in a myriad of ways but for a minimally viable, hit the ground running way of using the command all one need use is sessions. Using sessions you can spawn command prompts name them, delete them, switch between them and return to them whenever.
To start tmux with an initial session just type tmux and hit enter.
The way I typically start tmux is by typing tmux a which starts tmux with the last session used visible.
The tmux commands that I find essential to my workflow are:
  • Ctrl + b, s (to select a session)
  • Ctrl + b, :new (to create a new session)
  • Ctrl + b, $ (to rename the current session)
  • Ctrl + b, :kill-session to delete the current session and exit 
  • Ctrl + b, [ scroll mode (navigate with arrow keys, pgup, pgdn)
  • Ctrl + b, q to exit scroll mode

No comments:

Post a Comment