Bird
0
0

What will be the output of the following commands?

medium📝 Command Output Q4 of 15
Linux CLI - Linux Basics and Terminal
What will be the output of the following commands?
mkdir myfolder
cd myfolder
touch file1.txt
ls
Amyfolder
Bfile1.txt
CNo output
DError: directory not found
Step-by-Step Solution
Solution:
  1. Step 1: Analyze commands step-by-step

    mkdir myfolder creates a folder, cd myfolder moves inside it, touch file1.txt creates an empty file.
  2. Step 2: Understand 'ls' output

    ls lists files in current directory, which now contains file1.txt.
  3. Final Answer:

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

    ls after touch shows new file [OK]
Quick Trick: After creating a file, 'ls' shows it in the folder [OK]
Common Mistakes:
  • Expecting folder name in ls output
  • Thinking ls shows nothing
  • Assuming error without reason

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes