0
0
Linux CLIscripting~10 mins

tee for splitting output 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 save the output of ls command to a file files.txt while still showing it on the screen.

Linux CLI
ls | [1] files.txt
Drag options to blanks, or click blank then click option'
Acat
Bgrep
Ctee
Dawk
Attempts:
3 left
💡 Hint
Common Mistakes
Using cat which only reads files.
Using grep or awk which filter or process text but don't split output.
2fill in blank
medium

Complete the code to append the output of date command to log.txt while still showing it on the screen.

Linux CLI
date | [1] -a log.txt
Drag options to blanks, or click blank then click option'
Atee
Bcat
Chead
Dtail
Attempts:
3 left
💡 Hint
Common Mistakes
Using cat which does not write output to files.
Using head or tail which only show parts of input.
3fill in blank
hard

Fix the error in the code to save output of echo Hello to greeting.txt and still show it on screen.

Linux CLI
echo Hello | [1] greeting.txt
Drag options to blanks, or click blank then click option'
Acat
Btee
Cecho
Dls
Attempts:
3 left
💡 Hint
Common Mistakes
Using cat which reads files but does not write output here.
Using echo or ls which do not split output.
4fill in blank
hard

Fill both blanks to save output of ps aux to processes.txt and append output to all_processes.txt while showing on screen.

Linux CLI
ps aux | [1] processes.txt | [2] -a all_processes.txt
Drag options to blanks, or click blank then click option'
Atee
Bcat
Dgrep
Attempts:
3 left
💡 Hint
Common Mistakes
Using cat which does not split output.
Using grep which filters but does not write to files.
5fill in blank
hard

Fill all three blanks to save output of find . -type f to files.txt, append to all_files.txt, and filter lines containing .txt.

Linux CLI
find . -type f | [1] files.txt | [2] -a all_files.txt | [3] '.txt'
Drag options to blanks, or click blank then click option'
Atee
Cgrep
Dcat
Attempts:
3 left
💡 Hint
Common Mistakes
Using cat which does not write output to files.
Using grep before tee which changes output flow.