New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Finding disk usage by file type

Post Reply New Thread Subscribe

Thread Tools
Posts: n/a

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.
QUOTE Thanks
Posts: n/a

Originally posted by gatorparrots@Dec 23 2002, 09:34 PM
sudo find / -name "*.mp3" -print0 | xargs -0 du -ck
This will calculate the disk usage of all of your mp3 files.
Very neet, thanks.
QUOTE Thanks

Post Reply New Thread Subscribe

« Install Qpopper | Duplicate a CD/DVD-ROM via the command line »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
PowerBook seems slower WhitE_RabbiT Apple Notebooks 9 07-19-2004 08:59 AM
External Drive Corruption? mrrumfoord OS X - Operating System 2 05-17-2004 01:02 AM
Troubles with .html!!! (screwed up file type associations) Mainyehc OS X - Operating System 0 02-22-2004 09:49 AM
Slow disk to disk file transfer lmcilwain Other Hardware and Peripherals 0 02-19-2004 09:23 AM

All times are GMT -4. The time now is 04:53 AM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?