Recall & Review
beginner
What does the
nohup command do in Linux?The
nohup command runs a process that ignores the hangup signal, so it keeps running even after you close the terminal.Click to reveal answer
beginner
How do you run a script named
backup.sh persistently using nohup?Use
nohup ./backup.sh &. This runs the script in the background and keeps it running after logout.Click to reveal answer
intermediate
What file does
nohup use to save output if no output file is specified?It saves output to
nohup.out in the current directory or home directory if it can't write there.Click to reveal answer
beginner
Why do we add
& at the end of a nohup command?The
& puts the process in the background so you can keep using the terminal immediately.Click to reveal answer
intermediate
Can
nohup keep a process running after a system reboot?No,
nohup only keeps a process running after logout or terminal close. For reboot persistence, use system services or cron jobs.Click to reveal answer
What happens if you close the terminal after running
nohup myscript.sh &?✗ Incorrect
nohup ignores hangup signals, so the script keeps running even if the terminal closes.
Where does
nohup save output if you don't redirect it?✗ Incorrect
By default, nohup writes output to nohup.out in the current directory or home directory if it can't write there.
Which symbol is used to run a command in the background?
✗ Incorrect
The & symbol runs a command in the background.
Does
nohup guarantee a process will survive a system reboot?✗ Incorrect
nohup does not survive system reboots; it only ignores hangup signals from terminal close or logout.
What is the main reason to use
nohup?✗ Incorrect
nohup is used to keep processes running after logout or terminal close by ignoring hangup signals.
Explain how to use
nohup to run a script persistently and why it is useful.Think about running a long task and closing your terminal without stopping it.
You got /4 concepts.
Describe the limitations of
nohup regarding process persistence.Consider what happens when the computer restarts.
You got /4 concepts.