SlideShare a Scribd company logo
Understanding
tmux
By Mohamed Gamal
© Mohamed Gamal 2025
How to use tmux in Linux - A basic tutorial
What is tmux?
– tmux (short for Terminal Multiplexer) is a tool that allows you to manage multiple
terminal sessions from a single screen.
– It helps in multitasking by splitting windows into panes and maintaining sessions
even when disconnected.
$ sudo apt install -y tmux
Main Concepts
• Session → A collection of windows.
• Window → A full-screen terminal view.
• Pane → A split within a window.
How to use tmux in Linux - A basic tutorial
1. Session Management
$ tmux
$ tmux new -s <session_name> # Create a session with a name
Start a new session:
$ tmux ls
List all sessions:
$ tmux kill-session -t <session_name> # t: target
Kill a specific session:
$ tmux kill-server
Kill the tmux server (end all sessions):
$ tmux a # Attach to the last session
$ tmux a -t <session_name> # Attach to a specific session
Attach to a session:
CTRL+b d
Detach from a session (without exiting):
CTRL+b $
Rename a session:
2. Window Management
CTRL+b ,
Rename the current window:
Next window: CTRL+b n
Previous window: CTRL+b p
Go to a specific window: CTRL+b <window_index>
List all windows: CTRL+b w
Switch between windows:
CTRL+b c
Create a new window:
CTRL+b &
Close the current window:
3. Pane Management
Horizontally: CTRL+b "
Vertically: CTRL+b %
Split panes:
Use arrow keys: CTRL+b ←/↑/↓/→
Show pane numbers: CTRL+b q, then press the number of the pane.
Navigate between panes:
Fine resize (single step): CTRL+b CTRL+←/→Coarse
resize (larger steps): CTRL+b ALT+←/→
Resize panes:
CTRL+b SPACE
Cycle through pane layouts:
CTRL+b x
Close the current pane:
4. Copy and Paste
Enter copy mode: CTRL+[
Scroll through text in copy mode: ←/↑/↓/→
Select text in copy mode: CTRL+SPACE
Paste copied text: CTRL+w
Exit copy mode: CTRL+]
Split panes:
CTRL+b ?
View tmux shortcuts in your session:
$ man tmux
Access the tmux manual:
5. Help and Documentation
Command Description
CTRL+b d Detach from the session
CTRL+b c Create a new window
CTRL+b , Rename the current window
CTRL+b x Close the current pane
CTRL+b q Show pane numbers
CTRL+b SPACE Cycle through layouts
CTRL+b ←/↑/↓/→ Move between panes
CTRL+b CTRL+←/→ Fine resize panes
CTRL+b ALT+←/→ Coarse resize panes
Command Description
CTRL+[
CTRL+]
Copy and paste text
CTRL+b ? Show tmux help menu
$ tmux ls List all sessions
$ tmux kill-session –t <session_name> Kill a specific session
$ tmux kill-server Kill all sessions

More Related Content

Similar to How to use tmux in Linux - A basic tutorial (20)

PDF
tmux
Jason Lotito
 
PDF
screen and tmux
Hsi-Kai Wang
 
PDF
TMUX Rocks!
Kent Chen
 
PDF
Introduction to Tmux - Codementor Tmux Office Hours Part 1
Arc & Codementor
 
PPTX
Tmux Development Workflow
jschembri
 
PDF
2016 nov-16 grenoble-floss_tmux
Michael Bright
 
PDF
Get the most out of your Mac OS X
Janne Warén
 
PPTX
Improving your shell usage - 2009
Chris Sinjakli
 
KEY
Small Screen Development
Ralph von der Heyden
 
DOCX
C#_hw9_S17.docModify AnimatedBall on Chapter 13. Instead of dr.docx
RAHUL126667
 
DOC
Foss manual (1)
Janagi Raman S
 
PDF
30+ Computer Keyboard Shortcuts that will Change Your Life
Xplore - your web agency
 
PPTX
Command prompt presentation
Muhammad Taj
 
PPT
Mac OS X Basics
Arturo Collado
 
PPT
Mac OSX Basics
MALCLab
 
PPT
Mac OS X Basics
MALCLab
 
DOC
Linux Shortcuts and Commands:
wensheng wei
 
PPTX
Spf chapter 03 WinForm
Hock Leng PUAH
 
PPTX
SPF WinForm Programs
Hock Leng PUAH
 
screen and tmux
Hsi-Kai Wang
 
TMUX Rocks!
Kent Chen
 
Introduction to Tmux - Codementor Tmux Office Hours Part 1
Arc & Codementor
 
Tmux Development Workflow
jschembri
 
2016 nov-16 grenoble-floss_tmux
Michael Bright
 
Get the most out of your Mac OS X
Janne Warén
 
Improving your shell usage - 2009
Chris Sinjakli
 
Small Screen Development
Ralph von der Heyden
 
C#_hw9_S17.docModify AnimatedBall on Chapter 13. Instead of dr.docx
RAHUL126667
 
Foss manual (1)
Janagi Raman S
 
30+ Computer Keyboard Shortcuts that will Change Your Life
Xplore - your web agency
 
Command prompt presentation
Muhammad Taj
 
Mac OS X Basics
Arturo Collado
 
Mac OSX Basics
MALCLab
 
Mac OS X Basics
MALCLab
 
Linux Shortcuts and Commands:
wensheng wei
 
Spf chapter 03 WinForm
Hock Leng PUAH
 
SPF WinForm Programs
Hock Leng PUAH
 

More from Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt (20)

PDF
How to install CS50 Library (Step-by-step guide)
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Understanding Singular Value Decomposition (SVD)
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Understanding K-Nearest Neighbor (KNN) Algorithm
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Understanding Convolutional Neural Networks (CNN)
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Luhn's algorithm to validate Egyptian ID numbers
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Complier Design - Operations on Languages, RE, Finite Automata
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 5
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 2
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 1
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 3
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 4
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Understanding Convolutional Neural Networks (CNN)
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Complier Design - Operations on Languages, RE, Finite Automata
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 5
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 2
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 1
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 3
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 4
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Ad

Recently uploaded (20)

PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PPTX
infertility, types,causes, impact, and management
Ritu480198
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PDF
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
PPT
Indian Contract Act 1872, Business Law #MBA #BBA #BCOM
priyasinghy107
 
PPTX
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PPTX
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
PPTX
Light Reflection and Refraction- Activities - Class X Science
SONU ACADEMY
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Horarios de distribución de agua en julio
pegazohn1978
 
epi editorial commitee meeting presentation
MIPLM
 
infertility, types,causes, impact, and management
Ritu480198
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
Indian Contract Act 1872, Business Law #MBA #BBA #BCOM
priyasinghy107
 
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
Light Reflection and Refraction- Activities - Class X Science
SONU ACADEMY
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Controller Request and Response in Odoo18
Celine George
 
Ad

How to use tmux in Linux - A basic tutorial

  • 3. What is tmux? – tmux (short for Terminal Multiplexer) is a tool that allows you to manage multiple terminal sessions from a single screen. – It helps in multitasking by splitting windows into panes and maintaining sessions even when disconnected. $ sudo apt install -y tmux
  • 4. Main Concepts • Session → A collection of windows. • Window → A full-screen terminal view. • Pane → A split within a window.
  • 6. 1. Session Management $ tmux $ tmux new -s <session_name> # Create a session with a name Start a new session: $ tmux ls List all sessions: $ tmux kill-session -t <session_name> # t: target Kill a specific session:
  • 7. $ tmux kill-server Kill the tmux server (end all sessions): $ tmux a # Attach to the last session $ tmux a -t <session_name> # Attach to a specific session Attach to a session: CTRL+b d Detach from a session (without exiting): CTRL+b $ Rename a session:
  • 8. 2. Window Management CTRL+b , Rename the current window: Next window: CTRL+b n Previous window: CTRL+b p Go to a specific window: CTRL+b <window_index> List all windows: CTRL+b w Switch between windows: CTRL+b c Create a new window: CTRL+b & Close the current window:
  • 9. 3. Pane Management Horizontally: CTRL+b " Vertically: CTRL+b % Split panes: Use arrow keys: CTRL+b ←/↑/↓/→ Show pane numbers: CTRL+b q, then press the number of the pane. Navigate between panes:
  • 10. Fine resize (single step): CTRL+b CTRL+←/→Coarse resize (larger steps): CTRL+b ALT+←/→ Resize panes: CTRL+b SPACE Cycle through pane layouts: CTRL+b x Close the current pane:
  • 11. 4. Copy and Paste Enter copy mode: CTRL+[ Scroll through text in copy mode: ←/↑/↓/→ Select text in copy mode: CTRL+SPACE Paste copied text: CTRL+w Exit copy mode: CTRL+] Split panes:
  • 12. CTRL+b ? View tmux shortcuts in your session: $ man tmux Access the tmux manual: 5. Help and Documentation
  • 13. Command Description CTRL+b d Detach from the session CTRL+b c Create a new window CTRL+b , Rename the current window CTRL+b x Close the current pane CTRL+b q Show pane numbers CTRL+b SPACE Cycle through layouts CTRL+b ←/↑/↓/→ Move between panes CTRL+b CTRL+←/→ Fine resize panes CTRL+b ALT+←/→ Coarse resize panes
  • 14. Command Description CTRL+[ CTRL+] Copy and paste text CTRL+b ? Show tmux help menu $ tmux ls List all sessions $ tmux kill-session –t <session_name> Kill a specific session $ tmux kill-server Kill all sessions