Find the largest files under a directory

Bash

Sorts everything beneath the working directory by real disk usage and shows the twenty worst offenders.

# -a counts files as well as directories, -h prints human sizes
du -ah . 2>/dev/null \
  | sort -rh \
  | head -20

More in Shell

Random picks