010-160 · Question #34
What is true about a recursive directory listing?
The correct answer is A. It includes the content of sub-directories. A recursive directory listing (ls -R) descends into and displays the contents of all subdirectories within the target directory.
Question
Options
- AIt includes the content of sub-directories.
- BIt includes the permissions of the directory listed.
- CIt includes details of file system internals, such as inodes.
- DIt includes ownership information for the files.
- EIt includes a preview of content for each file in the directory.
How the community answered
(40 responses)- A88% (35)
- B8% (3)
- C3% (1)
- D3% (1)
Why each option
A recursive directory listing (ls -R) descends into and displays the contents of all subdirectories within the target directory.
The recursive flag (-R) instructs ls to traverse each subdirectory it encounters and list its contents, continuing this process for all nested levels. This is specifically what 'recursive' means in the context of directory listing.
Showing file permissions requires the long listing format flag (-l), not the recursive flag (-R).
Displaying inode numbers requires the -i flag; the recursive flag does not reveal filesystem internals such as inodes.
Ownership information is displayed with the long format flag (-l), not with recursive listing (-R).
ls does not preview or display file content in any mode - that functionality belongs to commands such as cat or less.
Concept tested: ls recursive listing flag behavior
Source: https://man7.org/linux/man-pages/man1/ls.1.html
Topics
Community Discussion
No community discussion yet for this question.