How to find total MB of a directory plus all subdirectories

Valent Turkovic valent.turkovic at gmail.com
Mon Jul 16 17:35:20 UTC 2007


On 3/6/07, Nigel Henry <cave.dnb at tiscali.fr> wrote:
> This is a silly question perhaps. I have my soundfiles in a directory named
> Sounds Library, this contains many subdirectories, which contain the .wav
> files.
>
> What command can I use to find out the disk space this directory is taking up,
> including all the files that are in the subdirectories?
>
> Nigel.
>
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>

Hi,
I hope you appreciate this great one-liner I found for enhaced 'du' -
it even knows how to sort kB, MB and GB sizes right!

ls -A | grep -v -e '^\.\.$' |xargs -i du -ks {} |sort -rn |head -11 |
awk '{print $2}' | xargs -i du -hs {}

Hope you like it.


-- 
http://kernelreloaded.blog385.com/
linux, blog, anime, spirituality, windsurf, wireless
registered as user #367004 with the Linux Counter, http://counter.li.org.
ICQ: 2125241
Skype: valent.turkovic




More information about the fedora-list mailing list