702-100 practice question 1 of 15

Which command can be used to display the local filesystems that are currently mounted'?

Full set: 60 questions
Answer options
A: cat /etc/fstab
B: df -h C du -s Correct answer
C: mount -a
D: rpcinfo
Correct Answer:
B. df -h C du -s
Explanation

The df (disk free) command is used to report file system disk space usage. When executed without any file or directory arguments, it displays information for all currently mounted file systems. The -h option formats the output in a "human-readable" format (e.g., using KB, MB, GB), making it easier to interpret. This command directly queries the kernel for the list of active mounts and their usage statistics, providing an accurate, real-time view of mounted filesystems.

Why Incorrect

A. cat /etc/fstab: This command displays the static configuration file for filesystems, not the list of currently mounted ones.
C. du -s: This command summarizes the disk usage of a specific directory or file, not the status of all mounted filesystems.
D. mount -a: This is an action command that attempts to mount all filesystems listed in /etc/fstab, not display what is already mounted.
E. rpcinfo: This utility is used to query RPC (Remote Procedure Call) services, often related to NFS, not to list all mounted filesystems.

References

1. GNU Coreutils Manual: The official documentation for df states, "If no file name is given, the space available on all currently mounted file systems is shown."

Source: GNU Coreutils, df invocation. Section 15.1.

Link: https://www.gnu.org/software/coreutils/manual/htmlnode/df-invocation.html

2. Linux Programmer's Manual (man pages): The fstab(5) man page describes /etc/fstab as a file containing "descriptive information about the various file systems" that the system can mount, confirming it is a configuration file.

Source: fstab(5) - Linux Programmer's Manual.

Link: https://man7.org/linux/man-pages/man5/fstab.5.html

3. Linux Programmer's Manual (man pages): The mount(8) man page specifies that the -a option will "Mount all filesystems... mentioned in fstab," identifying it as an action, not a display command.

Source: mount(8) - Linux Programmer's Manual.

Link: https://man7.org/linux/man-pages/man8/mount.8.html

4. Stanford University CS107 Courseware: Course materials for Computer Organization & Systems frequently introduce fundamental Unix/Linux commands. The df command is presented as the standard tool for checking disk space and viewing mounted partitions.

Source: Stanford University, CS107 - Programming Paradigms, Unix Guide.

Link: https://cs107.stanford.edu/resources/unix-guide.html (See section on "Disk Usage").

Scroll to Top