Cheatsheet tmux
Comandi del multiplexer di terminale tmux in linguaggio semplice: sessioni, finestre, riquadri divisi, input sincronizzato, copy mode e scripting su tmux 3.6.
Come funziona
tmux uses a three-level hierarchy: a persistent server holds sessions (projects), each session holds windows (tabs), and each window splits into panes. Detaching leaves the session running in the background so you can reconnect later; inside tmux, most key bindings start with the prefix Ctrl-b followed by one key.
Kit di sopravvivenza
I pochi comandi da imparare per primi.
40 comandi
Manage sessions (shell)
Sessions survive SSH disconnects and terminal restarts. Name every project session so attaching is effortless.
Documentazione ufficiale: tmux sessions- Essenziale
Create and attach to a named tmux session.
tmux new -s <name>Componi il comando
tmux new -s <name>I valori vengono inseriti esattamente come li digiti. Racchiudili tra virgolette se contengono spazi o caratteri speciali.
Quando usarlo
Names the session so you can return to the exact workspace after disconnecting or closing your terminal.
Dettaglio
- new
- alias for new-session
- -s <name>
- session name
Esempio
Starts a session named api.
tmux new -s apiFunziona anche
- tmux new-session -s <name>
Vedi anche
Windows (tabs)
Windows act like full-screen tabs inside a session. Each appears in the bottom status bar.
Documentazione ufficiale: Windows and panesSplit & navigate panes
Split one window into multiple panes to edit code beside logs or a test runner.
Documentazione ufficiale: Pane commandsScrollback & copy mode
tmux holds its own scrollback buffer per pane. Enter copy mode to scroll, search logs and copy without leaving the keyboard.
Documentazione ufficiale: Copy modeCommands & configuration
Customize prefix, mouse support and reload ~/.tmux.conf without restarting running sessions.
Documentazione ufficiale: Configuration & optionsProvalo in uno strumento di KitLocal
Glossario
- Prefix
- The shortcut pressed before a tmux command key. Default is Ctrl-b (release both keys before pressing the next key).
- Session
- A named workspace containing one or more windows that stays alive on the tmux server after you detach.
- Window
- A full-screen view inside a session (similar to a browser tab), numbered starting at 0 by default.
- Pane
- One rectangular terminal split inside a window, running its own shell.
- Copy mode
- A scrollback and selection mode entered with Ctrl-b [ so you can scroll up and copy text without a mouse.