Which command is used to display the disk usage of files and directories?

Prepare for the LPI 101-500 Certification Exam. Utilize flashcards, navigate multiple choice questions, and benefit from hints and explanations. Begin your Linux certification journey today!

The command used to display the disk usage of files and directories is represented accurately by the choice indicating "du." The "du" command, which stands for "disk usage," calculates and presents the amount of disk space used by specified files and directories. When executed, it provides a detailed output that includes the total size of files or the cumulative sizes of all files within specified directories.

By default, "du" summarizes disk usage for each directory and subdirectory, allowing users to easily ascertain how much space is being consumed within their filesystem. The command also offers various options, such as displaying sizes in human-readable format (like KB, MB, and GB) or allowing the user to specify depth levels within the directory structure.

In contrast, other commands like "df" are used for showing filesystem disk space usage overall, including free space on mounted filesystems, while "ls" lists directory contents and file details, and "stat" displays information about file or file system status, but does not provide specific disk usage. Thus, "du" is the suitable command in the context of analyzing disk space utilization for files and directories individually.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy