Bird
0
0

You have a directory with files app1.log, app2.log, and app_backup.log. You want to use tab completion to list only files ending with .log. How can you do this?

hard📝 Application Q9 of 15
Linux CLI - Navigating the File System
You have a directory with files app1.log, app2.log, and app_backup.log. You want to use tab completion to list only files ending with .log. How can you do this?
AType <code>ls app</code> and press Tab once
BType <code>ls *.log</code> and press Tab twice
CType <code>ls app</code> and press Enter
DTab completion cannot filter by file extension
Step-by-Step Solution
Solution:
  1. Step 1: Understand wildcard usage with tab completion

    Typing a pattern like '*.log' and pressing Tab twice lists matching files.
  2. Step 2: Analyze options

    Type ls *.log and press Tab twice uses the pattern and double Tab to list only .log files; others do not filter by extension.
  3. Final Answer:

    Type ls *.log and press Tab twice -> Option B
  4. Quick Check:

    Wildcard + double Tab = Filtered list [OK]
Quick Trick: Use wildcards with Tab to filter file lists [OK]
Common Mistakes:
  • Expecting single Tab to filter
  • Pressing Enter instead of Tab
  • Thinking filtering impossible

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes