Skip to content

Instantly share code, notes, and snippets.

@jcfrank
Created January 30, 2015 03:26
Show Gist options
  • Save jcfrank/58c34dc16860cd3716aa to your computer and use it in GitHub Desktop.
Save jcfrank/58c34dc16860cd3716aa to your computer and use it in GitHub Desktop.
sort files in current folder by sizes

List files in current folder and sort by their sizes.

find . -type f -print0 | du -a --files0-from=- | sort -n

Output example

...
268     ./flaskhost/lib/python2.7/lib-dynload/_codecs_jp.x86_64-linux-gnu.so
268     ./flaskhost/local/lib/python2.7/lib-dynload/_codecs_jp.x86_64-linux-gnu.so
312     ./flaskhost/lib/python2.7/site-packages/pip/_vendor/requests/cacert.pem
316     ./flaskhost/lib/python2.7/site-packages/pip/_vendor/certifi/cacert.pem
404     ./flaskhost/lib/python2.7/site-packages/jinja2/_stringdefs.py
3280    ./flaskhost/bin/python
3280    ./flaskhost/bin/python2
3280    ./flaskhost/bin/python2.7
3280    ./flaskhost/local/bin/python
3280    ./flaskhost/local/bin/python2
3280    ./flaskhost/local/bin/python2.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment