John needs to view the list of files and directories within the /office directory, including the files in subdirectories. Which of the following commands should he use?
  1. ls /office
  2. ls -l /office
  3. ls -f /office
  4. ls -R /office
Explanation
Answer - D - The command that should be used to view the list of files and directories within the /office directory, including the files in subdirectories, is ls -R/office.

Key Takeaway: The ls -R /office command will generate a listing of /office and its subdirectories. The ls command is used to list files. ls on its own lists all files in the current directory except for hidden files.
Was this helpful? Upvote!
Login to contribute your own answer or details

Top questions

Related questions

Most popular on PracticeQuiz