G
gatorparrots
Guest
You can easily find the disk usage by file type with this simple one-liner command.
sudo find / -name "*.mp3" -print0 | xargs -0 du -ck
This will calculate the disk usage of all of your mp3 files.
To make it more fun, throw an alias into your .*shrc file like so:
alias diskspc 'sudo find / -iname "*\!:1*" -print0 | xargs -0 du -cks'
This will net you the ability to search for any file type. For example issuing,
diskspc .tif would return the filesize for every tiff file, whether its extension .tif, .TIF, .tiff, or .TIFF.
(Note the case insensitivity provided by the -iname flag. Very handy for this application.)
Also, if you have fileutils installed, replace the flag on du with this one: du -chs
This will return the results in human-readable MB, instead of KB.
sudo find / -name "*.mp3" -print0 | xargs -0 du -ck
This will calculate the disk usage of all of your mp3 files.
To make it more fun, throw an alias into your .*shrc file like so:
alias diskspc 'sudo find / -iname "*\!:1*" -print0 | xargs -0 du -cks'
This will net you the ability to search for any file type. For example issuing,
diskspc .tif would return the filesize for every tiff file, whether its extension .tif, .TIF, .tiff, or .TIFF.
(Note the case insensitivity provided by the -iname flag. Very handy for this application.)
Also, if you have fileutils installed, replace the flag on du with this one: du -chs
This will return the results in human-readable MB, instead of KB.