Challenge - 5 Problems
Persistent Process Pro
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this nohup command?
You run the command
nohup sleep 10 & in a terminal. What will be the immediate output shown in the terminal?Linux CLI
nohup sleep 10 &Attempts:
2 left
💡 Hint
Think about what nohup does with output when running a command in background.
✗ Incorrect
The nohup command detaches the process from the terminal and redirects output to 'nohup.out' by default, printing a message about ignoring input and appending output.
🧠 Conceptual
intermediate2:00remaining
Why use nohup with background processes?
Which of the following best explains why you use
nohup when running a process in the background?Attempts:
2 left
💡 Hint
Think about what happens to normal background processes when you close the terminal.
✗ Incorrect
nohup prevents the process from receiving the hangup signal (SIGHUP) when the terminal closes, so the process keeps running.
🔧 Debug
advanced2:00remaining
Why does this nohup command fail to keep process running?
You run
nohup python myscript.py and then close the terminal, but the script stops immediately. What is the most likely reason?Linux CLI
nohup python myscript.py
Attempts:
2 left
💡 Hint
Think about how to run commands in background with nohup.
✗ Incorrect
Without & the command runs in foreground and closing terminal sends SIGHUP, stopping the process.
📝 Syntax
advanced2:00remaining
Which command correctly runs a persistent process with nohup and redirects output?
Choose the correct command to run
myapp persistently with nohup, sending all output to app.log and running in background.Attempts:
2 left
💡 Hint
Remember the order of output redirection and background symbol matters.
✗ Incorrect
Option D correctly redirects stdout and stderr to app.log and runs the process in background.
🚀 Application
expert3:00remaining
How many lines will nohup.out contain after running this command?
You run
nohup bash -c 'for i in {1..5}; do echo $i; sleep 1; done' and wait until it finishes. How many lines will the nohup.out file contain?Attempts:
2 left
💡 Hint
Each echo prints one line, and output goes to nohup.out by default.
✗ Incorrect
The loop prints numbers 1 to 5, each on its own line, so nohup.out will have 5 lines.