What command can be used to display disk usage of a directory?

Prepare for the Linux Professional Institute Certification Level 1. Use flashcards and multiple choice questions, complete with hints and explanations. Enhance your understanding and get ready to ace the exam!

The command that is used to display disk usage of a directory is 'du'. This command stands for "disk usage," and it summarizes the amount of disk space used by files and directories. When executed, 'du' can provide information about the size of a specified directory, along with its subdirectories, allowing users to see exactly how much space is being used.

For example, typing 'du' followed by a directory path will output the disk usage of that directory and each of its subdirectories. The command can also be modified with various options to customize the output, such as using the '-h' option for human-readable sizes (e.g., displaying sizes in KB, MB, or GB) or the '--max-depth' option to limit the depth of directory traversal.

In contrast, the other options do not serve this specific purpose. 'size' is not a standard command in Unix/Linux for checking disk usage. 'df' is used to report file system disk space usage, giving an overview of overall disk space available and used on mounted filesystems rather than on specific directories. Finally, 'diskusage' is not a recognized command in standard Unix/Linux systems. Therefore, 'du' is the appropriate choice when looking to check the disk

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy