Counting files of a particualr type
I am pretty sure there is an easier way to do this but this is how I done it the first time.
find ./ -name "*.ogg" -print | perl -wne '$i++; END{print "$i\n"}'
I then thought about it a bit and came up with
find ./ -name "*.ogg" -print | xargs ls | wc -l
now that is much neater ;) but wait, we don't need the "xargs ls"
find ./ -name "*.ogg" -print | wc -l
I then thought about doing it this way
ls -R | grep ".ogg" | wc -l
I'm going to leave it there ;)
0 TrackBacks
Listed below are links to blogs that reference this entry: Counting files of a particualr type.
TrackBack URL for this entry: http://www.hjackson.org/mt/mt-tb.fcgi/153






Leave a comment