O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sessions are invaluable

If you SSH into a machine to work, tmux is an essential tool you can use. tmux allows you to create long-lasting sessions, which outlive a single SSH connection.

If you're in a tmux session, you can detach from it by pressing Ctrl + b followed by d. You will be sent back in your shell with the following message:

[detached (from session 0)]

The session will be alive until your machine is powered off. To list tmux sessions, execute the following:

$ tmux list-sessions0: 2 windows (created Sat Aug 18 19:17:59 2018) [80x23]

As you can see, we currently have one session available. Let's open the session, or—in tmux termsattach to it:

$ tmux attach -t 0

Running tmux without any arguments always creates a new session.

You ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required