0
0
Linux CLIscripting~20 mins

tmux for persistent sessions in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Tmux Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of listing tmux sessions?
You have started two tmux sessions named work and play. What will be the output of the command tmux ls?
Linux CLI
tmux ls
A
work: 1 windows (created Wed Jun 14 10:00:00 2023) [80x24]
play: 1 windows (created Wed Jun 14 10:05:00 2023) [80x24]
B
work
play
CNo sessions found
Dtmux: command not found
Attempts:
2 left
💡 Hint
Think about how tmux shows session details with names and window counts.
💻 Command Output
intermediate
2:00remaining
What happens when you detach a tmux session?
You are inside a tmux session named dev. You run the command tmux detach. What is the immediate effect?
Linux CLI
tmux detach
AThe terminal closes immediately.
BThe tmux session is terminated and all processes inside it stop.
CYou get an error: 'detach: unknown command'
DYou exit the tmux session but it keeps running in the background.
Attempts:
2 left
💡 Hint
Detaching means leaving the session without stopping it.
📝 Syntax
advanced
2:00remaining
Which command attaches to a tmux session named 'project'?
You want to attach to an existing tmux session called project. Which command is correct?
Atmux connect project
Btmux start project
Ctmux attach -t project
Dtmux open -s project
Attempts:
2 left
💡 Hint
The attach command uses the -t option to specify the target session.
🚀 Application
advanced
2:00remaining
How to create a new tmux session named 'test' with a window running 'top'?
You want to start a new tmux session named test and immediately run the command top inside it. Which command achieves this?
Atmux new -s test 'top'
Btmux create test top
Ctmux start -n test top
Dtmux new-session -s test top
Attempts:
2 left
💡 Hint
Use the new session command with -s for session name and pass the command in quotes.
🔧 Debug
expert
2:00remaining
Why does this tmux command fail with 'unknown option' error?
You run the command tmux attach-session -d -t mysession but get an error: tmux: unknown option: -d. What is the reason?
Linux CLI
tmux attach-session -d -t mysession
AThe session 'mysession' does not exist, causing the error.
BThe -d option is not valid for attach-session; it belongs to new-session.
CYou need to run tmux as root to use the -d option.
DThe command should be run inside an existing tmux session.
Attempts:
2 left
💡 Hint
Check which commands support the -d option in tmux.