SlideShare a Scribd company logo
1 of 22
Download to read offline
Linux Command Line Multitasking
Amr Fawzy Mohammed
Outline
● Running process in the background
● Interacting with a backgrounded process
⚪ bg
⚪ fg
⚪ Jobs
● Manage virtual terminal sessions with Screen
● Tmux: Terminal Multiplexer
Running a process in the background
Bash and some other popular shells like zsh and ksh let us run a process in the
background.
The easiest way to have a task run in the background is to start it out there.
$ command &
The o/p will be the job number and the process id.
Running a process in the background (cont.)
If the process/application is already running and we want to send it back to
the background, then just press ctrl + z
The process will be stopped and sent to the background.
Interacting with a backgrounded process
List : is used to list the active jobs.
$ jobs
bg : is used to resume the backgrounded stopped process and let it run in the
background.
$ bg %job_number
fg : bring the backgrounded process to the foreground.
$ fg %job_number
Interacting with a backgrounded process (cont.)
Jobs are interactive processes running in the background.
lists process IDs in addition to the normal information.
$ jobs -l
Sending signals to jobs
$ kill -STOP process_ID or %job’s_number
$ kill -CONT process_ID or %job’s_number
Terminating jobs
$ kill %job’s_number
Interacting with a backgrounded process (cont.)
disown: is used to To removes a job from the table of active jobs.
$ disown job’s_number
Check :
$ jobs
The process is still running and can be found by running
$ ps aux | grep process’s_id
Manage virtual terminal sessions with Screen
GNU Screen is a tool which works with a terminal session to allow users to resume a session after
they have disconnected.
Screen creates virtual terminals that lives beyond the current session, so we can disconnect, come
back later and call the virtual terminal we were working on and the files we were working with will
still be open, and the processes we had running will still be active.
Screen Default keybinding / prefix is $ ctrl+a
Screen (cont.)
Installing screen on ubuntu
$ sudo apt-get install screen
Installing screen on CentOS
$ yum install screen
To start screen session
$ screen or $ screen -S screen_nam
List all screen sessions
$ screen -ls
Managing Screen Attachment
Resumes a detached screen session.
$ screen -r screen_id/name
Resumes screen usually when only one screen is detached.
$ screen -R
Reattach a session and if necessary detach it first.
$ screen -dr screen_id/name
Attach to a not detached screen session (Multi display mode).
$ screen -x screen_id/name
Detach from a screen session without impacting the running processes.
Ctrl+a d
Manipulating Screen windows
Once entered the screen session, all commands will be issued using the
default keybinding/prefix ctrl+a
Creates a new Screen window.
Prefix + c
List all windows and and switch to desired one using the arrow keys.
Prefix + “
Show list of the opened windows.
Prefix + w
Switches between windows 0 through 9.
Prefix + 0-9
Manipulating Screen windows (cont.)
Switch to the next/previous window.
Prefix + n/p
Toggle to the window displayed previously.
Prefix + prefix
Destroy current window.
Prefix + k
Kill all windows and terminate screen.
Prefix + 
Detach screen from this terminal.
Prefix + d
Manipulating Screen windows (cont.)
Clear window.
Prefix + C
enter a name for the current window.
Prefix + A
Enter command line mode.
Prefix + :
Suspend the screen and go back to the original shell session
Prefix + z
Manipulating Screen windows (cont.)
Split the current region horizontally into two new ones.
Prefix + S
Split the current region vertically into two new ones.
Prefix + |
Switch the cursor to the next region.
Prefix + <tab>
Kill the current region.
Prefix + X
Tmux: Terminal Multiplexer
Tmux is a terminal multiplexer, It creates a host server on your remote
machine and connects to it with a client window.
If the client is disconnected, the server keeps running. When you reconnect to
your remote machine after rebooting your computer or losing your Internet
connection, you can reattach to the tmux session and the files you were
working with will still be open, and the processes you had running will still be
active.
Tmux (cont.)
Installing tmux on ubuntu
$ sudo apt-get install tmux
Installing tmux on CentOS
$ yum install tmux
To start tmux session
$ tmux or $ tmux new-session -s session_name
List all tmux sessions
$ tmux ls
Managing tmux Attachment
Attach to a tmux session
$ tmux attach -t session_name or $ tmux attach
Detach from a tmux session
$ tmux detach or prefix +d
Manage tmux Windows
Create a new window.
Prefix + c
Change to the next/previous window.
Prefix + n/p
Select windows 0 to 9.
Prefix + 0-9
Choose the current window interactively.
Prefix + w
Kill the current window.
Prefix + &
Rename a window.
Prefix + ,
Manage tmux Panes
Each window can be divided into multiple panes.
Split the active pane horizontally.
Prefix + “
Split the active pane vertically.
Prefix + %
Switch to another pane.
Prefix + arrow key
Resize the active pane
Prefix + ALT + arrow key
Zoom in on the active pane.
Prefix + z
Manage tmux Sessions
Switch to the previous session.
Prefix + (
Switch to the next session.
Prefix + )
Display an interactive session list.
Prefix + s
Rename the current session.
Prefix + $
Kill the tmux server and clients and destroy all sessions.
$ tmux kill-server
Destroy a specific session.
$ tmux kill-session -t session_name
References
● Screen and Tmux man pages.
● Linode tmux and screen tutorials.
● Lynda “Linux: Multitasking at the Command Line” course.

More Related Content

What's hot

Improving your shell usage - 2009
Improving your shell usage - 2009Improving your shell usage - 2009
Improving your shell usage - 2009Chris Sinjakli
 
Ezekiel how to
Ezekiel how toEzekiel how to
Ezekiel how toEKInyang
 
Diagrama de flujo de simulacion de variables
Diagrama de flujo de simulacion de variablesDiagrama de flujo de simulacion de variables
Diagrama de flujo de simulacion de variablesErickPea26
 
Praktikum Komputasi Statistika
Praktikum Komputasi StatistikaPraktikum Komputasi Statistika
Praktikum Komputasi StatistikaDian Arisona
 

What's hot (8)

GNU Screen
GNU ScreenGNU Screen
GNU Screen
 
Improving your shell usage - 2009
Improving your shell usage - 2009Improving your shell usage - 2009
Improving your shell usage - 2009
 
CS3241 Lab A1
CS3241 Lab A1CS3241 Lab A1
CS3241 Lab A1
 
Vi editor in linux
Vi editor in linuxVi editor in linux
Vi editor in linux
 
Ezekiel how to
Ezekiel how toEzekiel how to
Ezekiel how to
 
Diagrama de flujo de simulacion de variables
Diagrama de flujo de simulacion de variablesDiagrama de flujo de simulacion de variables
Diagrama de flujo de simulacion de variables
 
Vi editor
Vi editorVi editor
Vi editor
 
Praktikum Komputasi Statistika
Praktikum Komputasi StatistikaPraktikum Komputasi Statistika
Praktikum Komputasi Statistika
 

Similar to Linux Command Line Multitasking

Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:wensheng wei
 
20 keyboard shortcuts for your linux machine
20 keyboard shortcuts for your linux machine20 keyboard shortcuts for your linux machine
20 keyboard shortcuts for your linux machineYoussoufou YABRE
 
Using the Command Line with Magento
Using the Command Line with MagentoUsing the Command Line with Magento
Using the Command Line with MagentoMatthew Haworth
 
RedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksRedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksMd Shihab
 
InstructionsInstructions for numberguessernumberGuesser.html.docx
InstructionsInstructions for numberguessernumberGuesser.html.docxInstructionsInstructions for numberguessernumberGuesser.html.docx
InstructionsInstructions for numberguessernumberGuesser.html.docxdirkrplav
 
Tmux Development Workflow
Tmux Development WorkflowTmux Development Workflow
Tmux Development Workflowjschembri
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationJacobMenke1
 
Tmux cheatsheet
Tmux cheatsheetTmux cheatsheet
Tmux cheatsheetIan Yang
 
Tmux quick intro
Tmux quick introTmux quick intro
Tmux quick introdantleech
 
Vim Hacks (OSSF)
Vim Hacks (OSSF)Vim Hacks (OSSF)
Vim Hacks (OSSF)Lin Yo-An
 
macbook for beginners
macbook for beginnersmacbook for beginners
macbook for beginnersTegan Ambrosa
 
Linux commands part3
Linux commands part3Linux commands part3
Linux commands part3bhatvijetha
 
Get the most out of your Mac OS X
Get the most out of your Mac OS XGet the most out of your Mac OS X
Get the most out of your Mac OS XJanne Warén
 
Processes And Job Control
Processes And Job ControlProcesses And Job Control
Processes And Job Controlahmad bassiouny
 

Similar to Linux Command Line Multitasking (20)

screen and tmux
screen and tmuxscreen and tmux
screen and tmux
 
Linux Shortcuts and Commands:
Linux Shortcuts and Commands:Linux Shortcuts and Commands:
Linux Shortcuts and Commands:
 
20 keyboard shortcuts for your linux machine
20 keyboard shortcuts for your linux machine20 keyboard shortcuts for your linux machine
20 keyboard shortcuts for your linux machine
 
lec4.docx
lec4.docxlec4.docx
lec4.docx
 
TMUX Rocks!
TMUX Rocks!TMUX Rocks!
TMUX Rocks!
 
Using the Command Line with Magento
Using the Command Line with MagentoUsing the Command Line with Magento
Using the Command Line with Magento
 
RedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksRedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative works
 
Foss manual (1)
Foss manual (1)Foss manual (1)
Foss manual (1)
 
InstructionsInstructions for numberguessernumberGuesser.html.docx
InstructionsInstructions for numberguessernumberGuesser.html.docxInstructionsInstructions for numberguessernumberGuesser.html.docx
InstructionsInstructions for numberguessernumberGuesser.html.docx
 
Clase10 (consola linux)
Clase10 (consola linux)Clase10 (consola linux)
Clase10 (consola linux)
 
Tmux Development Workflow
Tmux Development WorkflowTmux Development Workflow
Tmux Development Workflow
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup Presentation
 
Tmux cheatsheet
Tmux cheatsheetTmux cheatsheet
Tmux cheatsheet
 
Unix t2
Unix t2Unix t2
Unix t2
 
Tmux quick intro
Tmux quick introTmux quick intro
Tmux quick intro
 
Vim Hacks (OSSF)
Vim Hacks (OSSF)Vim Hacks (OSSF)
Vim Hacks (OSSF)
 
macbook for beginners
macbook for beginnersmacbook for beginners
macbook for beginners
 
Linux commands part3
Linux commands part3Linux commands part3
Linux commands part3
 
Get the most out of your Mac OS X
Get the most out of your Mac OS XGet the most out of your Mac OS X
Get the most out of your Mac OS X
 
Processes And Job Control
Processes And Job ControlProcesses And Job Control
Processes And Job Control
 

Recently uploaded

Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Gáspár Nagy
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabbereGrabber
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1KnowledgeSeed
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfMehmet Akar
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionWave PLM
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationWave PLM
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdfkalichargn70th171
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...rajkumar669520
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfmbmh111980
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...Alluxio, Inc.
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAlluxio, Inc.
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems ApproachNeo4j
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Krakówbim.edu.pl
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Soroosh Khodami
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAlluxio, Inc.
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfTestgrid.io
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024Shane Coughlan
 

Recently uploaded (20)

Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
How to pick right visual testing tool.pdf
How to pick right visual testing tool.pdfHow to pick right visual testing tool.pdf
How to pick right visual testing tool.pdf
 
5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand
 
OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024OpenChain @ LF Japan Executive Briefing - May 2024
OpenChain @ LF Japan Executive Briefing - May 2024
 

Linux Command Line Multitasking

  • 1.
  • 2. Linux Command Line Multitasking Amr Fawzy Mohammed
  • 3. Outline ● Running process in the background ● Interacting with a backgrounded process ⚪ bg ⚪ fg ⚪ Jobs ● Manage virtual terminal sessions with Screen ● Tmux: Terminal Multiplexer
  • 4. Running a process in the background Bash and some other popular shells like zsh and ksh let us run a process in the background. The easiest way to have a task run in the background is to start it out there. $ command & The o/p will be the job number and the process id.
  • 5. Running a process in the background (cont.) If the process/application is already running and we want to send it back to the background, then just press ctrl + z The process will be stopped and sent to the background.
  • 6. Interacting with a backgrounded process List : is used to list the active jobs. $ jobs bg : is used to resume the backgrounded stopped process and let it run in the background. $ bg %job_number fg : bring the backgrounded process to the foreground. $ fg %job_number
  • 7. Interacting with a backgrounded process (cont.) Jobs are interactive processes running in the background. lists process IDs in addition to the normal information. $ jobs -l Sending signals to jobs $ kill -STOP process_ID or %job’s_number $ kill -CONT process_ID or %job’s_number Terminating jobs $ kill %job’s_number
  • 8. Interacting with a backgrounded process (cont.) disown: is used to To removes a job from the table of active jobs. $ disown job’s_number Check : $ jobs The process is still running and can be found by running $ ps aux | grep process’s_id
  • 9. Manage virtual terminal sessions with Screen GNU Screen is a tool which works with a terminal session to allow users to resume a session after they have disconnected. Screen creates virtual terminals that lives beyond the current session, so we can disconnect, come back later and call the virtual terminal we were working on and the files we were working with will still be open, and the processes we had running will still be active. Screen Default keybinding / prefix is $ ctrl+a
  • 10. Screen (cont.) Installing screen on ubuntu $ sudo apt-get install screen Installing screen on CentOS $ yum install screen To start screen session $ screen or $ screen -S screen_nam List all screen sessions $ screen -ls
  • 11. Managing Screen Attachment Resumes a detached screen session. $ screen -r screen_id/name Resumes screen usually when only one screen is detached. $ screen -R Reattach a session and if necessary detach it first. $ screen -dr screen_id/name Attach to a not detached screen session (Multi display mode). $ screen -x screen_id/name Detach from a screen session without impacting the running processes. Ctrl+a d
  • 12. Manipulating Screen windows Once entered the screen session, all commands will be issued using the default keybinding/prefix ctrl+a Creates a new Screen window. Prefix + c List all windows and and switch to desired one using the arrow keys. Prefix + “ Show list of the opened windows. Prefix + w Switches between windows 0 through 9. Prefix + 0-9
  • 13. Manipulating Screen windows (cont.) Switch to the next/previous window. Prefix + n/p Toggle to the window displayed previously. Prefix + prefix Destroy current window. Prefix + k Kill all windows and terminate screen. Prefix + Detach screen from this terminal. Prefix + d
  • 14. Manipulating Screen windows (cont.) Clear window. Prefix + C enter a name for the current window. Prefix + A Enter command line mode. Prefix + : Suspend the screen and go back to the original shell session Prefix + z
  • 15. Manipulating Screen windows (cont.) Split the current region horizontally into two new ones. Prefix + S Split the current region vertically into two new ones. Prefix + | Switch the cursor to the next region. Prefix + <tab> Kill the current region. Prefix + X
  • 16. Tmux: Terminal Multiplexer Tmux is a terminal multiplexer, It creates a host server on your remote machine and connects to it with a client window. If the client is disconnected, the server keeps running. When you reconnect to your remote machine after rebooting your computer or losing your Internet connection, you can reattach to the tmux session and the files you were working with will still be open, and the processes you had running will still be active.
  • 17. Tmux (cont.) Installing tmux on ubuntu $ sudo apt-get install tmux Installing tmux on CentOS $ yum install tmux To start tmux session $ tmux or $ tmux new-session -s session_name List all tmux sessions $ tmux ls
  • 18. Managing tmux Attachment Attach to a tmux session $ tmux attach -t session_name or $ tmux attach Detach from a tmux session $ tmux detach or prefix +d
  • 19. Manage tmux Windows Create a new window. Prefix + c Change to the next/previous window. Prefix + n/p Select windows 0 to 9. Prefix + 0-9 Choose the current window interactively. Prefix + w Kill the current window. Prefix + & Rename a window. Prefix + ,
  • 20. Manage tmux Panes Each window can be divided into multiple panes. Split the active pane horizontally. Prefix + “ Split the active pane vertically. Prefix + % Switch to another pane. Prefix + arrow key Resize the active pane Prefix + ALT + arrow key Zoom in on the active pane. Prefix + z
  • 21. Manage tmux Sessions Switch to the previous session. Prefix + ( Switch to the next session. Prefix + ) Display an interactive session list. Prefix + s Rename the current session. Prefix + $ Kill the tmux server and clients and destroy all sessions. $ tmux kill-server Destroy a specific session. $ tmux kill-session -t session_name
  • 22. References ● Screen and Tmux man pages. ● Linode tmux and screen tutorials. ● Lynda “Linux: Multitasking at the Command Line” course.