Bird
0
0

You run mv file1.txt file2.txt but get an error: mv: cannot move 'file1.txt' to 'file2.txt': No such file or directory. What is the likely cause?

medium📝 Debug Q6 of 15
Linux CLI - File and Directory Operations
You run mv file1.txt file2.txt but get an error: mv: cannot move 'file1.txt' to 'file2.txt': No such file or directory. What is the likely cause?
Afile1.txt does not exist in the current directory.
Bfile2.txt already exists and is write-protected.
CYou do not have permission to rename files.
DThe mv command syntax is incorrect.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze error message

    The error says source file cannot be found, indicating file1.txt is missing.
  2. Step 2: Check other options

    Write protection or permissions cause different errors. Syntax error would show usage message.
  3. Final Answer:

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

    mv error 'No such file' = source missing [OK]
Quick Trick: Check source file exists if mv says 'No such file' [OK]
Common Mistakes:
MISTAKES
  • Assuming destination file causes error
  • Blaming permissions without checking
  • Misreading error message

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes