0
0
Linux CLIscripting~30 mins

tmux for persistent sessions in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Using tmux for Persistent Sessions
📖 Scenario: You are working on a remote Linux server via SSH. You want to run commands that keep running even if your connection drops. Using tmux, a terminal multiplexer, helps you keep sessions alive and reconnect later.
🎯 Goal: Learn how to create a tmux session, run commands inside it, detach from the session, and reattach later to continue your work without interruption.
📋 What You'll Learn
Create a new tmux session named work_session
Run a long-running command inside the tmux session
Detach from the tmux session
Reattach to the tmux session to see the running command
💡 Why This Matters
🌍 Real World
Using tmux helps system administrators and developers keep their work running on remote servers without interruption, even if their network connection drops.
💼 Career
Knowing tmux is essential for roles involving remote server management, DevOps, and cloud infrastructure where persistent sessions improve productivity and reliability.
Progress0 / 4 steps
1
Create a new tmux session
Type the command to create a new tmux session named work_session.
Linux CLI
Need a hint?

Use tmux new -s session_name to create a new session with a name.

2
Run a long-running command inside tmux
Inside the work_session tmux session, run the command ping google.com to start a continuous ping.
Linux CLI
Need a hint?

Just type ping google.com after starting the tmux session.

3
Detach from the tmux session
Detach from the work_session tmux session by typing the key combination Ctrl+b then d.
Linux CLI
Need a hint?

Press Ctrl and b together, release, then press d to detach.

4
Reattach to the tmux session
Type the command to reattach to the existing tmux session named work_session.
Linux CLI
Need a hint?

Use tmux attach -t session_name to reconnect to a session.