Bird
0
0

A user runs ls -lR /home/user but the output is too long and scrolls off screen. How can they fix this?

medium📝 Debug Q7 of 15
Linux CLI - Navigating the File System
A user runs ls -lR /home/user but the output is too long and scrolls off screen. How can they fix this?
APipe the output to <code>less</code> using <code>ls -lR /home/user | less</code>
BAdd the <code>-a</code> option to show hidden files
CUse <code>ls -l /home/user</code> without -R
DRedirect output to a file using <code>ls -lR /home/user > output.txt</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand the problem

    The output is too long and scrolls off screen, so the user needs a way to view it page by page.
  2. Step 2: Use paging with less

    Piping output to less allows scrolling up/down easily.
  3. Final Answer:

    Pipe the output to less using ls -lR /home/user | less -> Option A
  4. Quick Check:

    Piping to less = Easy scrolling [OK]
Quick Trick: Use | less to scroll long command output [OK]
Common Mistakes:
  • Adding -a doesn't fix scrolling
  • Removing -R changes output content
  • Redirecting to file doesn't help immediate view

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes