12-20-2001
1,626,
15
Join Date: Jul 2001
Last Activity: 16 June 2011, 4:50 PM EDT
Location: Portland, OR, USA
Posts: 1,626
Thanks Given: 2
Thanked 15 Times in 13 Posts
Well, as I understand it, you want to find out how many files of a given name exists on the entire system...
Say you're counting the number of files named "tmp.sh" in the entire system:
find / -name tmp.sh | wc -l 2>/dev/null
You'll probably want the "2>/dev/null" on the end - it will take any errors and silently throw them away. This is especially helpfull if you run this as anormal user (not root).
Now say you want to find certain types of files in only your home directory:
find /your/home -name "*.sh" | wc -l
man find and man wc for more info... There's dozens of different way you can write your "find" to find very specific files...