Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to run the command sleep 10 in the background.
Bash Scripting
sleep 10 [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ';' runs the command sequentially, not in background.
Using '|' pipes output, not background execution.
Using '&&' runs next command only if previous succeeds.
✗ Incorrect
The ampersand (&) at the end of a command runs it in the background in bash.
2fill in blank
mediumComplete the code to run ping -c 4 google.com in the background.
Bash Scripting
ping -c 4 google.com [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&&' runs next command only if ping succeeds.
Using '|' pipes output, not background execution.
Using ';' runs commands sequentially.
✗ Incorrect
Adding '&' runs the ping command in the background, letting you use the terminal immediately.
3fill in blank
hardFix the error in the code to run ls -l in the background.
Bash Scripting
ls -l [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&&' or ';' runs commands sequentially.
Using '|' pipes output instead of background execution.
✗ Incorrect
The correct symbol to run a command in the background is '&'.
4fill in blank
hardComplete the code to run echo Hello in the background and then list files.
Bash Scripting
echo Hello [1] ls ; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&&' after echo waits for it to finish.
Using '|' pipes output instead of running commands separately.
✗ Incorrect
Use '&' to run echo in background, then ';' to run ls after.
5fill in blank
hardFill both blanks to run sleep 5 in background, then print Done, and finally list files.
Bash Scripting
sleep 5 [1] echo Done [2] ls ;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '|' pipes output instead of sequencing commands.
Using ';' after sleep runs commands sequentially, not background.
✗ Incorrect
Use '&' to run sleep in the background, '&&' after echo to run ls only if echo succeeds, and ';' after ls.