Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
ls instead of the file name after cat.Adding options like
-l which cat does not use.✗ Incorrect
The
cat command followed by the filename notes.txt displays the file's contents.2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas between file names instead of spaces.
Adding unsupported options like
-a or -l.✗ Incorrect
Listing the two filenames separated by a space after
cat displays their contents in order.3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding unsupported options like
-r.Misspelling the filename.
✗ Incorrect
The correct command is
cat report.txt. Options like -r are invalid for cat, and misspelled filenames cause errors.4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
cat instead of tac for reverse display.Swapping the filenames or commands.
✗ Incorrect
The command
tac log1.txt displays the contents of log1.txt in reverse order. Here, tac is the reverse of cat.5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using only one input file.
Redirecting output to an input file.
Swapping input and output files.
✗ Incorrect
The command
cat part1.txt part2.txt > full.txt joins the two files and writes the output to full.txt.