tmux
is a must-have. It can be a bit overwhelming for those who are just getting started, so in this tutorial we'll walk through the basics of getting tmux
set up, basic navigation, and a few possible configurations.
Prerequisites
- A VPS running Ubuntu, Debian, or CentOS
- Or, your local machine (running OpenBSD, FreeBSD, NetBSD, Linux, OS X, or Solaris)
Installing tmux
To install on an Ubuntu/Debian VPS, type in the following:$ sudo apt-get install tmux
And on CentOS:
$ sudo yum install tmux
Managing sessions
The core oftmux
is sessions. Here's where you can create separate environments that persist, even when you detach from them.
For example, many developers like to create separate sessions for individual projects they're working on, or, if they work from home, they'll create a "work" and "home" session to keep things separate.
Feel free to rename session
to anything you would like.
Create a new session
$ tmux new -s session
Attach to an existing session
$ tmux attach -t session
$ tmux a -t session
Switch to an existing session
$ tmux switch -t session_name
List sessions
$ tmux list-sessions
$ tmux ls
Detach from the session
$ tmux detach
End a session
$ tmux kill-session -t myname
Using windows, aka tabs
Each session can contain a number of windows, which behave like tabs. You can create different windows for different commands or editors for dealing with files.Create a new window
$ tmux new-window
Continue reading this article
by subscribing to our newsletter.Subscribe now
A note about tutorials: We encourage our users to try out tutorials, but they aren't fully supported by our team—we can't always provide support when things go wrong. Be sure to check which OS and version it was tested with before you proceed.
If you want a fully managed experience, with dedicated support for any application you might want to run, contact us for more information.
Continue reading this article
by subscribing to our newsletter.
Subscribe nowby subscribing to our newsletter.
A note about tutorials: We encourage our users to try out tutorials, but they aren't fully supported by our team—we can't always provide support when things go wrong. Be sure to check which OS and version it was tested with before you proceed.
If you want a fully managed experience, with dedicated support for any application you might want to run, contact us for more information.