Bird
0
0

Given the commands:

medium📝 Command Output Q4 of 15
Linux CLI - File and Directory Operations
Given the commands:
touch file1.txt
mkdir archive
mv file1.txt archive/
What will be the output of ls archive/?
Afile1.txt
Barchive
Cfile1.txt archive
DNo output, directory is empty
Step-by-Step Solution
Solution:
  1. Step 1: Analyze commands

    touch file1.txt creates an empty file. mkdir archive creates a directory. mv file1.txt archive/ moves the file into the directory.
  2. Step 2: Check contents of archive directory

    After moving, archive/ contains file1.txt.
  3. Final Answer:

    file1.txt -> Option A
  4. Quick Check:

    mv moves file inside directory = file appears there [OK]
Quick Trick: After mv file dir/, file appears inside dir/ [OK]
Common Mistakes:
  • Expecting directory name as output
  • Thinking directory remains empty
  • Confusing file and directory listing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes