Skip to content
shellmap

Find files larger than 100MB

List files exceeding a size threshold — useful for cleanup, quota enforcement, and identifying log-rotation gaps.

How to find files larger than 100mb in each shell

Bashunix
find . -type f -size +100M
Zshunix
find . -type f -size +100M
Fishunix
find . -type f -size +100M
PowerShellwindows
Get-ChildItem -Recurse -File | Where-Object Length -gt 100MB
cmd.exewindows
forfiles /S /M *.* /C "cmd /c if @fsize gtr 104857600 echo @path"

Equivalents listed for Bash, Zsh, Fish, PowerShell, cmd.exe.

Gotchas & notes

  • `find -size +100M` interprets `M` as 1048576 BYTES (binary MiB) on both GNU and BSD find. Other units: `c` (bytes), `k` (KiB), `M` (MiB), `G` (GiB). `find -size +100c` is "+100 BYTES" — easy off-by-six-orders-of-magnitude mistake when you mean MB. ALWAYS pair the number with an explicit unit suffix.
  • pwsh literal sizes are BINARY: `100MB` literal = `104857600` (= 100 × 1024²). The pwsh `1MB` and Linux `M` both mean MiB despite the casual "MB" label — they coincide. There's no `1MiB` literal in pwsh, but `1GB = 1073741824` matches `1GiB` semantics. Drive-vendor "MB"/"GB" are decimal (10⁶/10⁹). A "100 MB" log file holds 100,000,000 bytes ≈ 95.37 MiB. Don't mix the two in capacity-planning math.
  • Sort by size descending (largest first): `find . -type f -size +100M -exec ls -lh {} + | sort -k5 -rh | head -20` (GNU `sort -h` is human-numeric — works with `100M`/`1.2G`; BSD lacks `-h`, use `du -h | sort -h` after `brew install coreutils` `gsort`). pwsh: `Get-ChildItem -Recurse -File | Where-Object Length -gt 100MB | Sort-Object Length -Descending | Select-Object -First 20`.
  • Big-files-by-directory roll-up: `du -ahx . | sort -h | tail -20` shows the 20 largest leaves (files + dirs). For files-only: `find . -type f -size +100M -printf "%s\t%p\n" | sort -n -k1` (GNU `-printf` only — macOS BSD lacks). The `-x` keeps `du` from crossing filesystem boundaries (don't accidentally recurse into a 4TB mounted NAS).

Related commands

Related tasks