How to use tmux?

QuestionsQuestions8 SkillsProBasic Files OperationsSep, 13 2025
0154

Here’s a quick guide on how to use tmux:

Starting a tmux Session

  1. Open your terminal.
  2. Start a new tmux session by typing:
    tmux

Detaching from a Session

  • To detach from the current session (leave it running in the background), press:
    Ctrl + b, then d

Reattaching to a Session

  • To reattach to a detached session, use:
    tmux attach-session
    or if you have multiple sessions:
    tmux attach-session -t <session-name>

Creating a New Window

  • To create a new window within the tmux session, press:
    Ctrl + b, then c

Switching Between Windows

  • To switch to the next window, press:
    Ctrl + b, then n
  • To switch to the previous window, press:
    Ctrl + b, then p

Splitting Windows

  • To split the window horizontally, press:
    Ctrl + b, then "
  • To split the window vertically, press:
    Ctrl + b, then %

Closing a Window or Pane

  • To close the current window or pane, type:
    exit

Listing Sessions

  • To list all tmux sessions, use:
    tmux ls

Exiting tmux

  • To exit tmux completely, make sure to close all windows or panes, or you can type:
    exit

This should give you a good starting point for using tmux. Let me know if you need more specific commands or features!

0 Comments

no data
Be the first to share your comment!