Show total, used, available, and percentage usage for each mounted filesystem in human-readable units.
Which command is appropriate?
df -h shows Size, Used, Avail, Use%, and Mounted on for mounted filesystems using readable units.
Detailed explanation
df -hCorrect. df -h displays mounted filesystem capacity and usage.
Correct. df -h displays mounted filesystem capacity and usage.
du -hIncorrect. du summarizes files and directories within a tree.
Incorrect. du summarizes files and directories within a tree.
lsblk -bIncorrect. lsblk -b shows block-device sizes in bytes, not filesystem usage percentages.
Incorrect. lsblk -b shows block-device sizes in bytes, not filesystem usage percentages.
free -hIncorrect. free -h reports RAM and swap usage.
Incorrect. free -h reports RAM and swap usage.
Try it yourself
An example you can run in a temporary verification environment.
df -h | sed -n '1,6p'Expected result
Filesystem、Size、Used、Avail、Use%、Mounted onの一覧Key points
- df is filesystem-level usage
- -h means human-readable
- du measures directory contents
Notes
- Environment: GNU coreutils df / 読み取り操作
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.