Bird
0
0

You want to list all files in a directory, filter those containing "report", then sort them in reverse order. Which command correctly uses pipes to do this?

hard📝 Application Q8 of 15
Linux CLI - Pipes and Redirection
You want to list all files in a directory, filter those containing "report", then sort them in reverse order. Which command correctly uses pipes to do this?
Als | sort -r | grep report
Bgrep report | ls | sort -r
Cls | grep report | sort -r
Dsort -r | ls | grep report
Step-by-Step Solution
Solution:
  1. Step 1: Determine correct command order

    First list files with ls, then filter with grep report, finally sort in reverse with sort -r.
  2. Step 2: Validate pipe sequence

    ls | grep report | sort -r follows correct order. Options A, C, D have commands in wrong order or invalid pipe usage.
  3. Final Answer:

    ls | grep report | sort -r -> Option C
  4. Quick Check:

    Logical pipe order = list -> filter -> sort [OK]
Quick Trick: Pipe commands in logical sequence for correct output [OK]
Common Mistakes:
  • Sorting before filtering
  • Starting with grep without input
  • Wrong pipe order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes