Interview Questions/Phone Screen/Check Disk Space in Linux
BeginnerPhone
1 min

Check Disk Space in Linux

LinuxSystem Administration
Advertisement
Interview Question

Which Linux command quickly shows disk usage for all mounted filesystems in a human-readable format?

Key Points to Cover
  • Use `df -h` to display disk usage per filesystem
  • `-h` flag makes sizes human-readable
Evaluation Rubric
Mentions `df` command60% weight
Includes `-h` for readability40% weight
Hints
  • 💡Think: "disk free".
Common Pitfalls to Avoid
  • ⚠️Only stating `df` without the `-h` flag, which results in output in 1K blocks, making it difficult to read quickly.
  • ⚠️Confusing `df` (disk free, for filesystems) with `du` (disk usage, for files and directories).
  • ⚠️Failing to explain *why* the command is important beyond just stating what it does (e.g., for monitoring, capacity planning).
  • ⚠️Not mentioning the specific benefits of the `-h` flag (i.e., making sizes human-readable like GB, MB).
  • ⚠️Giving a one-word or very brief answer without elaborating on the functionality or practical use of the command.
Potential Follow-up Questions
  • How do you check inode usage?
  • What about `du` vs `df` differences?
Advertisement