Craig Reyenga wrote:
find /path/to/dir -type f -name db\* -print | wc -l

would count the number of files that begin with 'db' in the name, under the
'/path/to/dir' directory. man find and man wc for more action.


Be careful in case that directory contains subdirectories, since 'find' will traverse them by default as well. If you want to count files only in the directory level of '/path/to/dir' you may want to add '-maxdepth 1', like so:


find /path/to/dir -type f -name db\* -maxdepth 1 -print | wc -l

   Uwe
--
Uwe Doering         |  EscapeBox - Managed On-Demand UNIX Servers
[EMAIL PROTECTED]  |  http://www.escapebox.net
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to