In tmux, you can create a new session using the tmux command followed by the new-session command. Here's the basic syntax:
bash
tmux new-session -s session_name
Replace session_name with the desired name for your new session. If you don't specify a name, tmux will assign a default name.
Here are a few examples:
To create a new session named "mysession":
bash
tmux new-session -s mysession
To create a new session without specifying a name:
bash
tmux new-session
After running the new-session command, you will be switched to the new session. You can then use tmux commands to manage and navigate between sessions.
Here are some useful tmux session management commands:
Switching between sessions:
- Switch to the last session:
tmux switch-client -n - Switch to a specific session by name:
tmux switch-client -t session_name
- Switch to the last session:
Listing sessions:
- List existing sessions:
tmux list-sessionsortmux ls
- List existing sessions:
Detaching from a session:
- Detach from the current session (leave it running in the background):
tmux detach-client
- Detach from the current session (leave it running in the background):
Attaching to a session:
- Attach to the last session:
tmux attach - Attach to a specific session by name:
tmux attach -t session_name
- Attach to the last session:
Killing a session:
- Kill a session:
tmux kill-session -t session_name
- Kill a session:
Remember that you can customize the key bindings and create scripts to simplify these commands based on your preferences. To customize tmux behavior, you can add configurations to your ~/.tmux.conf file.
No comments:
Post a Comment