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-sessions
0: 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 can have as many sessions as you want, if you prefer to separate work on different projects using different sessions! It's often helpful to divide projects or different tasks by sessions. You can navigate sessions from within tmux using Ctrl + b followed by ( or ).

You can also name your sessions, either when invoking tmux (tmux new -s name) or from within tmux (Ctrl + b and $).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.188.16