How to check disk and folder usage

Overview

df reports free space on mounted filesystems. du estimates how much space files and directories consume.

Examples

df -h
du -sh ~/Downloads
du -h --max-depth=1 ~
du -sh ./* 2>/dev/null

Useful options

  • -h uses human-readable units
  • df -T also shows filesystem types
  • du -s gives one summary total
  • du --max-depth=1 summarizes immediate children
  • du -a includes individual files

Tips

A full filesystem can prevent updates and logins. Start with your home and downloads directories; do not delete unfamiliar files under system directories.

du may report permission errors outside your account. Do not add sudo merely to suppress them.