Challenge - 5 Problems
Cat Command Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:00remaining
What is the output of this command?
You have a file named
What will be the output of the command
example.txt with the following content:Hello World
What will be the output of the command
cat example.txt?Linux CLI
cat example.txt
Attempts:
2 left
💡 Hint
The
cat command prints the file content exactly as it is.✗ Incorrect
The
cat command outputs the content of the file preserving line breaks. So it prints 'Hello' on the first line and 'World' on the second line.💻 Command Output
intermediate1:00remaining
What happens when you use cat on multiple files?
You have two files:
What is the output of
file1.txt contains:Apple
file2.txt contains:Banana
What is the output of
cat file1.txt file2.txt?Linux CLI
cat file1.txt file2.txt
Attempts:
2 left
💡 Hint
The
cat command concatenates files and prints their contents in order.✗ Incorrect
The command prints the content of
file1.txt followed by the content of file2.txt, preserving line breaks.💻 Command Output
advanced1:00remaining
What is the output of this command with a non-existent file?
What happens when you run
cat missing.txt if missing.txt does not exist?Linux CLI
cat missing.txt
Attempts:
2 left
💡 Hint
Try to think what happens when a file is not found.
✗ Incorrect
The
cat command prints an error message to standard error if the file does not exist.💻 Command Output
advanced1:00remaining
What is the output of this command with input redirection?
What will be the output of
cat < file.txt if file.txt contains:Line1 Line2?
Linux CLI
cat < file.txt
Attempts:
2 left
💡 Hint
Input redirection feeds the file content to the command as standard input.
✗ Incorrect
Using input redirection,
cat reads from the file and outputs its content preserving line breaks.🧠 Conceptual
expert1:30remaining
How many lines will this command output?
You run the command
What is the output number?
cat fileA.txt fileB.txt | wc -l.fileA.txt has 3 lines, fileB.txt has 5 lines.What is the output number?
Attempts:
2 left
💡 Hint
The pipe sends combined output of both files to
wc -l which counts lines.✗ Incorrect
The
cat command concatenates both files, so total lines are 3 + 5 = 8. The wc -l counts these lines.