commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
This is easy to type if you are looking for a few (hundred) "missing" megabytes (and don't mind the occasional K slipping in)...
A variation without false positives and also finding gigabytes (but - depending on your keyboard setup - more painful to type):
du -hs *|grep -P '^(\d|,)+(M|G)'|sort -n
(NOTE: you might want to replace the ',' according to your locale!)
Don't forget that you can
modify the globbing as needed! (e.g. '.[^\.]* *' to include hidden files and directories (w/ bash))
in its core similar to:
There are 3 alternatives - vote for the best!
sorts the files by integer megabytes, which should be enough to (interactively) find the space wasters. Now you can
for the above output,
dush -n 3
for only the 3 biggest files and so on. It's always a good idea to have this line in your .profile or .bashrc
An NCurses version of the famous old 'du' unix command
ncdu is a text-mode ncurses-based disk usage analyzer. Useful for when you want to see where all your space is going. For a single flat directory it isn't more elaborate than an du|sort or some such thing, but this analyzes all directories below the one you specify so space consumed by files inside subdirectories is taken into account. This way you get the full picture. Features: file deletion, file size or size on disk and refresh as contents change. Homepage: http://dev.yorhel.nl/ncdu
If you can do better, submit your command here.
You must be signed in to comment.