Timedora
Free Practice Quiz Question List

Linux File Metadata with `ls` and `stat` Online Quiz Questions

Use this free practice quiz with 20 questions to review Linux File Metadata with `ls` and `stat`, test your knowledge, and prepare for your next test or exam.

20 questions
01
Choose one
1 point

Which command displays a long listing for the directory named reports itself, rather than listing the directory’s contents?

  1. A

    ls -l reports

  2. B

    ls -ld reports

  3. C

    stat -L reports

  4. D

    ls -lh reports

02
Choose all
1 point

Select all statements that accurately describe using ls or stat to inspect file metadata.

  1. A

    ls -l provides a quick overview of file metadata.

  2. B

    stat provides a more detailed report of file status information.

  3. C

    GNU ls -lh displays file size in a human-readable scaled format.

  4. D

    ls -l normally reports the disk space allocated to a file, not its logical size.

  5. E

    A directory’s displayed size in ls -l is the total size of everything inside it.

03
True or false
1 point

In an ls -l listing, a directory’s displayed size is the total size of everything stored inside that directory.

  1. A

    True

  2. B

    False

04
Written response
1 point

Which GNU ls option requests that ownership be shown as numeric user and group IDs?

05
Fill in the blank
1 point

The size shown for a file by ls -l is normally expressed in .

06
Open ended
1 point

What information does ls -l show for a regular file, and which command can provide a more detailed report of file status?

07
Choose one
1 point

On GNU/Linux, which command follows the symbolic link latest to inspect its target?

  1. A

    stat always follows a symbolic link to its target.

  2. B

    ls -ld follows a symbolic link and displays the target’s metadata.

  3. C

    On GNU/Linux, stat -L latest follows the symbolic link latest to its target.

  4. D

    A symbolic link’s target is shown as the file’s modification time.

08
Choose all
1 point

Select all statements that accurately describe ownership and size information in a long listing.

  1. A

    Owner and group columns may show account names or numeric IDs.

  2. B

    Owner and group columns show which permissions the file grants.

  3. C

    The size in ls -l is normally the file’s size in bytes.

  4. D

    A file’s logical size can differ from the disk space allocated to it.

  5. E

    GNU ls -lh requests numeric user and group IDs.

09
Written response
1 point

Which command displays a long listing whose default timestamp is normally a file’s modification time?

10
Fill in the blank
1 point

In a regular file’s ls -l listing, one field gives the file’s , and another gives its .

11
Choose one
1 point

Which command displays information about the reports directory itself rather than listing the directory’s contents?

  1. A

    ls -l reports

  2. B

    ls -ld reports

  3. C

    stat -L reports

  4. D

    ls -n reports

12
Written response
1 point

Which GNU ls command requests numeric user and group IDs instead of account names?

13
Choose one
1 point

A user needs to access a known entry by path inside a directory. Which directory permission is required for that traversal?

  1. A

    Read permission, but not search permission

  2. B

    Write permission, but not search permission

  3. C

    Search permission, even if read permission is absent

  4. D

    No directory permission, if the file itself is readable

14
True or false
1 point

GNU ls -n requests numeric user and group IDs in the listing.

  1. A

    True

  2. B

    False

15
Written response
1 point

On GNU/Linux, what option makes stat follow a symbolic link to its target?

16
Choose one
1 point

Which command is described as providing a more detailed report of a file’s status information?

  1. A

    stat notes.txt

  2. B

    ls -l notes.txt

  3. C

    ls -ld notes.txt

  4. D

    ls -n notes.txt

17
Written response
1 point

In what unit does ls -l normally show a file’s size?

18
Choose one
1 point

How does a symbolic link appear in an ls -l listing?

  1. A

    The link name is followed by the target in parentheses.

  2. B

    The link name is followed by -> and its target.

  3. C

    The target is shown before the link name, separated by a colon.

  4. D

    The link’s target is not displayed in a long listing.

19
Choose one
1 point

For a regular file, which set of fields does a typical ls -l listing show?

  1. A

    Type and permissions, owner, group, size, access time, and name

  2. B

    Type and permissions, hard-link count, owner, group, size, modification time, and name

  3. C

    Type and permissions, owner, group, allocated disk space, creation time, and name

  4. D

    Type and permissions, hard-link count, owner, group, size, status-change time, and name

20
Choose one
1 point

On GNU/Linux, what is the difference between running stat latest and stat -L latest when latest is a symbolic link?

  1. A

    stat follows the link to its target by default, and stat -L reports the link itself.

  2. B

    Both stat and stat -L report only the symbolic link itself.

  3. C

    stat normally reports the symbolic link itself, while stat -L follows it to the target.

  4. D

    Both stat and stat -L follow the link to its target.