TestOut Linux Pro Practice Test 2025 – Complete Exam Prep Guide

Question: 1 / 400

Which command would you use to check space used by a specific directory?

df -h

du -sh

The command to check space used by a specific directory is "du -sh". The "du" command stands for "disk usage," and it's specifically designed to estimate file space usage. The "-s" option provides a summary, displaying only the total space used by the specified directory rather than listing space usage for each file and subdirectory within it. The "-h" option makes the output human-readable, meaning it will display the sizes in a format that is easier to interpret, such as KB, MB, or GB.

This command is particularly useful when you want to quickly see how much space a directory is consuming without delving into the details of its contents. In contrast, the other options focus on different aspects of system monitoring. For example, "df -h" shows the overall disk space used on all mounted filesystems, "stat" provides detailed information about a specific file or filesystem, and "free" displays memory usage rather than disk usage. Thus, "du -sh" is indeed the most appropriate choice for checking space used by a specific directory.

Get further explanation with Examzify DeepDiveBeta

stat

free

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy