Bird
0
0

You run cat file1.txt file2.txt but get an error: cat: file2.txt: No such file or directory. What is the most likely cause?

medium📝 Debug Q14 of 15
Linux CLI - Viewing and Editing Files
You run cat file1.txt file2.txt but get an error: cat: file2.txt: No such file or directory. What is the most likely cause?
AYou used the wrong command syntax
Bfile1.txt is empty
Cfile2.txt does not exist in the current directory
DYou do not have permission to read file1.txt
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the error message

    The error says file2.txt is missing, so the system cannot find it in the current directory.
  2. Step 2: Check other options

    Empty file1.txt or permission issues on file1.txt would not cause this error. The syntax is correct for displaying multiple files.
  3. Final Answer:

    file2.txt does not exist in the current directory -> Option C
  4. Quick Check:

    Missing file causes 'No such file' error [OK]
Quick Trick: Check file existence if 'No such file' error appears [OK]
Common Mistakes:
  • Assuming syntax error
  • Ignoring missing file
  • Blaming permissions wrongly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes