nerdexam
LPI

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.

Finding Your Way on a Linux System

Question

What is true about a recursive directory listing?

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)
  • A
    88% (35)
  • B
    8% (3)
  • C
    3% (1)
  • D
    3% (1)

Why each option

A recursive directory listing (ls -R) descends into and displays the contents of all subdirectories within the target directory.

AIt includes the content of sub-directories.Correct

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.

BIt includes the permissions of the directory listed.

Showing file permissions requires the long listing format flag (-l), not the recursive flag (-R).

CIt includes details of file system internals, such as inodes.

Displaying inode numbers requires the -i flag; the recursive flag does not reveal filesystem internals such as inodes.

DIt includes ownership information for the files.

Ownership information is displayed with the long format flag (-l), not with recursive listing (-R).

EIt includes a preview of content for each file in the directory.

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

#ls command#recursive listing#directory contents#file listing

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice