Which command can be used to check disk usage of 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 check disk usage of directories is "du," which stands for disk usage. When executed, the "du" command provides a report of the disk space utilized by a directory and its subdirectories. It summarizes the total space used for each directory level, which allows users to identify how much space is consumed on a per-directory basis.

The "du" command can also be modified with various options, such as displaying sizes in a human-readable format (typically using the -h flag) or by summarizing total usage with the -s flag. This command is particularly useful for managing disk space and identifying any directories that may be consuming excessive storage.

Other commands related to disk space may not provide the same level of detail for directories. For example, "df" gives an overview of available and used disk space on mounted filesystems rather than specific directories. "ls" merely lists files and directories along with their basic attributes, while "ncdu" is a more advanced tool for analyzing disk usage interactively but is not as straightforward as "du" for simple queries.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy