Which command shows the size of a directory in a human-readable form?

Prepare for the Google Data Center Technician Exam. Use our interactive quiz featuring flashcards and multiple choice questions with hints and explanations. Get exam-ready today!

Multiple Choice

Which command shows the size of a directory in a human-readable form?

Explanation:
To see how much disk space a directory uses, you use the du command, which reports the disk usage of files and directories. The -s option gives a single total for the specified directory, and -h formats that number in human-readable units (K, M, G). Running du -sh /path outputs the total size of /path, including all subdirectories and files inside it. Other options don’t provide a single, human-readable total for just that directory: df shows filesystem usage rather than a directory’s size, ls -lh lists individual file sizes, and du -a shows every file and directory’s size instead of a summed total.

To see how much disk space a directory uses, you use the du command, which reports the disk usage of files and directories. The -s option gives a single total for the specified directory, and -h formats that number in human-readable units (K, M, G). Running du -sh /path outputs the total size of /path, including all subdirectories and files inside it. Other options don’t provide a single, human-readable total for just that directory: df shows filesystem usage rather than a directory’s size, ls -lh lists individual file sizes, and du -a shows every file and directory’s size instead of a summed total.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy