0
0
Linux CLIscripting~10 mins

cat (display file contents) 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 command to display the contents of a file named notes.txt.

Linux CLI
cat [1]
Drag options to blanks, or click blank then click option'
A-l
Becho
Cls
Dnotes.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using ls instead of the file name after cat.
Adding options like -l which cat does not use.
2fill in blank
medium

Complete the command to display the contents of two files, file1.txt and file2.txt, one after the other.

Linux CLI
cat [1]
Drag options to blanks, or click blank then click option'
A-a file1.txt file2.txt
Bfile1.txt file2.txt
Cfile1.txt,file2.txt
D-l file1.txt file2.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas between file names instead of spaces.
Adding unsupported options like -a or -l.
3fill in blank
hard

Fix the error in the command to display the contents of report.txt.

Linux CLI
cat [1]
Drag options to blanks, or click blank then click option'
Areport.txt
B-r report.txt
Creport.txt -r
Dreporttxt
Attempts:
3 left
💡 Hint
Common Mistakes
Adding unsupported options like -r.
Misspelling the filename.
4fill in blank
hard

Fill both blanks to create a command that shows the contents of log1.txt in reverse order using tac.

Linux CLI
[1] [2]
Drag options to blanks, or click blank then click option'
Atac
Bcat
Clog2.txt
Dlog1.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using cat instead of tac for reverse display.
Swapping the filenames or commands.
5fill in blank
hard

Fill all four blanks to create a command that concatenates part1.txt and part2.txt and saves the result to full.txt.

Linux CLI
[1] [2] [3] > [4]
Drag options to blanks, or click blank then click option'
Acat
Bpart1.txt
Cfull.txt
Dpart2.txt
Attempts:
3 left
💡 Hint
Common Mistakes
Using only one input file.
Redirecting output to an input file.
Swapping input and output files.