Bird
0
0

What will be the output of the command ls -l /tmp if the /tmp directory contains two files named file1.txt and file2.log?

medium📝 Command Output Q13 of 15
Linux CLI - Navigating the File System
What will be the output of the command ls -l /tmp if the /tmp directory contains two files named file1.txt and file2.log?
Afile1.txt file2.log
BDetailed list showing permissions, owner, size, and date for file1.txt and file2.log
COnly hidden files in /tmp
DAn error saying /tmp does not exist
Step-by-Step Solution
Solution:
  1. Step 1: Understand -l option with ls

    The -l option shows a detailed list including permissions, owner, size, and modification date.
  2. Step 2: Apply to /tmp directory contents

    Since /tmp has two files, the command will show detailed info lines for both files.
  3. Final Answer:

    Detailed list showing permissions, owner, size, and date for file1.txt and file2.log -> Option B
  4. Quick Check:

    ls -l = detailed list [OK]
Quick Trick: -l means long detailed listing [OK]
Common Mistakes:
  • Expecting just filenames without details
  • Thinking it lists only hidden files
  • Assuming it shows an error if directory exists

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes