tmux basic commands

Introduction to tmux

tmux is a terminal multiplexer that allows you to run multiple terminal sessions within a single window. It provides a way to organize and manage multiple terminal sessions, detach from them, and reattach to them later. This can be particularly useful when working on remote servers or when you need to keep long-running processes running in the background.

Basic tmux Commands

Here are some basic tmux commands that you can use:

  • tmux new-session: This command creates a new tmux session.
  • tmux attach-session: This command attaches to an existing tmux session.
  • tmux detach-client: This command detaches the current client from the tmux session.
  • tmux switch-client -t target-session: This command switches to a different tmux session.
  • tmux list-sessions: This command lists all the active tmux sessions.
  • tmux kill-session -t target-session: This command kills a specific tmux session.
  • tmux split-window: This command splits the current pane into two panes, either horizontally or vertically.
  • tmux resize-pane -U/D/L/R size: This command resizes the current pane in the specified direction (up, down, left, or right) by the specified size.
  • tmux select-pane -U/D/L/R: This command switches focus to the pane in the specified direction (up, down, left, or right).
  • tmux send-keys: This command sends keystrokes to the currently active pane.

These are just a few of the basic commands available in tmux. There are many more advanced features and commands that you can explore. To learn more about tmux and its commands, you can refer to the official documentation or search for online tutorials and guides.