tmux – virtual consoles, background jobs and the like
In this section, we will be looking at another great tool called tmux. Tmux comes in particularly handy when working in remote ssh
sessions, because it gives you the ability to continue your work from where you left off. It can also replace some of the features in terminator, if you are working, for example, on Mac, and you can't install terminator.
To get started with tmux
on Ubuntu, we first need to install it:
sudo apt install tmux
Then just run the command:
tmux
And you will find yourself inside a brand new virtual console:
For demonstration purposes, we will open up a new tab that you can see the list of open sessions with tmux ls
:
Let's start a new tmux
named session:
tmux new -s mysession
Here we can see that opening a tmux
session maintains the current directory. To list and switch tmux
sessions inside tmux
, hit Ctrl + B S.
We can see that we can switch to another tmux session, execute commands inside, and switch back...