Skip to content

Instantly share code, notes, and snippets.

@addiedx44
Last active January 24, 2018 15:19
Show Gist options
  • Save addiedx44/5297971 to your computer and use it in GitHub Desktop.
Save addiedx44/5297971 to your computer and use it in GitHub Desktop.
List large files in order of size
sudo du -h / 2>/dev/null | grep '^\([0-9.]*G\|[0-9]\{3,\}M\)' | sort -h
@aconbere
Copy link

aconbere commented Apr 3, 2013

Bah, accidentally deleted my comment :P

Randomly saw this on the gists home page, just wanted to let you know about the -k flag to sort.

du | sort -k 1 -g

What I wanted to say, was that I liked the -h flag which doesn't exist on OS X's version of sort.

du -h | sort -k 1 -h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment