Click to See Complete Forum and Search --> : count number of files??


berb
10-21-2001, 03:56 AM
I have all my mp3s in a directory off root /music/Music/*. How do I count the number of individual files in this directory? There are 200 or so sub folders and some artists have sub directories (ie /music/Music/Sonic Youth/1000 Leaves or .../Daydream Nation.) is there an easy way to count all my mp3 files is the short question? (passing ls to wc won't work cause some files have more that one work per title). Running KDE, so file proprerties doesn't show all files, just number of directories.
TIA -d

berb
10-21-2001, 03:59 AM
writing it out helped me figure it out with :
ls -lR | wc -l

hmmmm, RTFM sometimes works

slacker_x
10-21-2001, 12:17 PM
that won't work because it spits out some blank lines and directory names.

find /path/to/dir/ -type f | wc -l

That should work. There might be a better way, but I don't know it.

[ 21 October 2001: Message edited by: slacker_x ]