0
0
Bash Scriptingscripting~10 mins

Running commands in background (&) in Bash Scripting - 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 the command sleep 10 in the background.

Bash Scripting
sleep 10 [1]
Drag options to blanks, or click blank then click option'
A&&
B;
C|
D&
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.
2fill in blank
medium

Complete 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'
A&
B;
C|
D&&
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&&' runs next command only if ping succeeds.
Using '|' pipes output, not background execution.
Using ';' runs commands sequentially.
3fill in blank
hard

Fix 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'
A&
B|
C&&
D;
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&&' or ';' runs commands sequentially.
Using '|' pipes output instead of background execution.
4fill in blank
hard

Complete 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'
A&
B&&
C;
D|
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&&' after echo waits for it to finish.
Using '|' pipes output instead of running commands separately.
5fill in blank
hard

Fill 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'
A&
B&&
C;
D|
Attempts:
3 left
💡 Hint
Common Mistakes
Using '|' pipes output instead of sequencing commands.
Using ';' after sleep runs commands sequentially, not background.