Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to list all files and then count the lines using the pipe operator.
Linux CLI
ls -l [1] wc -l Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&' runs commands in background, not piping output.
Using '>' redirects output to a file, not to another command.
Using ';' runs commands sequentially but does not pipe output.
✗ Incorrect
The pipe operator '|' sends the output of the first command as input to the second command.
2fill in blank
mediumComplete the code to find all '.txt' files and count them using the pipe operator.
Linux CLI
find . -name '*.txt' [1] wc -l
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&&' instead of pipe, which does not pass output.
Using '>' redirects output to a file, not to another command.
Using ';' runs commands one after another without piping.
✗ Incorrect
The pipe '|' passes the list of found files to 'wc -l' to count them.
3fill in blank
hardFix the error in the code to correctly pipe the output of 'ps aux' to 'grep bash'.
Linux CLI
ps aux [1] grep bash Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&' runs command in background, not piping output.
Using '||' runs second command only if first fails, no piping.
Using '>' redirects output to a file, not to another command.
✗ Incorrect
The pipe '|' correctly sends the output of 'ps aux' to 'grep bash' for filtering.
4fill in blank
hardFill both blanks to list all running processes and filter those containing 'ssh'.
Linux CLI
ps [1] [2] grep ssh
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '&&' instead of pipe, which does not pass output.
Using 'aux' with '&&' instead of pipe.
Not using any option with 'ps' to list all processes.
✗ Incorrect
Use 'ps -ef' to list all processes and pipe '|' to 'grep ssh' to filter them.
5fill in blank
hardFill all three blanks to list files, filter those with '.log', and count them.
Linux CLI
ls [1] [2] grep [3] | wc -l
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-a' instead of '-l' for listing files.
Using ';' or '&&' instead of pipe '|'.
Not specifying '.log' to filter log files.
✗ Incorrect
Use 'ls -l' to list files, pipe '|' to 'grep .log' to filter log files, then count lines with 'wc -l'.