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 Doering         |  EscapeBox - Managed On-Demand UNIX Servers
[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to