Find the largest files / directories on the server

Public

To find the largest 20 files:

Get raw version
bash
  1. find . -type f -print0 | xargs -0 du | sort -n | tail -20 | cut -f2 | xargs -I{} du -sh {}

To find the largest 20 directories

Get raw version
bash
  1. find . -type d -print0 | xargs -0 du | sort -n | tail -20 | cut -f2 | xargs -I{} du -sh {}