find out disk space used by certain type of files

It’s very easy to check how much does certain files occupied your hard disk space. I’m using this technique before moving my files to other host to estimate how long will it takes to do some transfer. We will use find command to do this (and some pipelining)

What does it means?
the “find” command will search for all files matching (case-insensitive) pattern *.mp3 beginning from the current directory. For each file name found, do “du -b” on that file (it means: show the file size in bytes). Then “awk” will summarize all of the files size then at the end, show it to user. The total result would be in bytes.

Leave a Reply

%d bloggers like this: