0
0
Linux CLIscripting~10 mins

nohup for persistent processes in Linux CLI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run a command that keeps running after logout using nohup.

Linux CLI
nohup [1] &
Drag options to blanks, or click blank then click option'
Aexit
Bls
Ccd /home
Dsleep 60
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands that finish immediately like ls.
Using commands that change directory like cd.
2fill in blank
medium

Complete the code to redirect nohup output to a file named output.log.

Linux CLI
nohup sleep 60 [1] output.log &
Drag options to blanks, or click blank then click option'
A>
B>>
C2>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using >> appends instead of overwriting.
Using < is for input redirection.
3fill in blank
hard

Fix the error in the command to run a script persistently with nohup.

Linux CLI
nohup [1] script.sh &
Drag options to blanks, or click blank then click option'
Abash
Bexecute
Crun
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like run or execute which do not exist.
Forgetting to specify the shell to run the script.
4fill in blank
hard

Fill both blanks to run a Python script persistently and redirect both output and errors to log.txt.

Linux CLI
nohup python3 [1] [2] log.txt &
Drag options to blanks, or click blank then click option'
Ascript.py
B>
C2>&1
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using input redirection < instead of output.
Not specifying the script file name.
5fill in blank
hard

Fill all three blanks to run a long command persistently, redirect output and errors to nohup.out, and run in background.

Linux CLI
nohup [1] [2] nohup.out [3] &
Drag options to blanks, or click blank then click option'
Along_running_command
B>
C2>&1
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using input redirection < instead of output.
Not redirecting errors properly.