Check total, used, available capacity, and usage percentage for the mounted filesystem containing /var.
Use human-readable units.
Which command is appropriate?
df -h PATH reports capacity, used space, free space, and usage percentage for the filesystem containing PATH. Use du for a directory-tree total.
Detailed explanation
du -sh /varIncorrect. du measures the directory tree's usage, not filesystem free space.
Incorrect. du measures the directory tree's usage, not filesystem free space.
df -h /varCorrect. df -h /var reports capacity and free space for the containing filesystem.
Correct. df -h /var reports capacity and free space for the containing filesystem.
df -i /varIncorrect. df -i reports inode counts rather than block capacity.
Incorrect. df -i reports inode counts rather than block capacity.
tune2fs -l /varIncorrect. tune2fs -l reads ext filesystem parameters and is not the general free-space command.
Incorrect. tune2fs -l reads ext filesystem parameters and is not the general free-space command.
Try it yourself
An example you can run in a temporary verification environment.
df -h /varExpected result
/varを格納するファイルシステムの容量行Key points
- df reports filesystem-wide values
- -h uses readable units
- Contrast df with du
Notes
- Environment: GNU coreutils 9.x
- 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.