Simple file count question

Craig Reyenga craig at
Mon Mar 15 23:12:24 PST 2004

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.


----- Original Message -----
From: "Dave Carrera" <dave at>
To: <freebsd-questions at>
Sent: Tuesday, March 16, 2004 2:01 AM
Subject: Simple file count question

Hi List,

I know this is going to be simple but I cant find a suitable answer by
trawling the web so I ask how do I count the number of certain files in a

So I am in my dir and want to count how many files begin with db and show me
the number.

I hope you can help me and thank you in advance for any help you may give

Dave C

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.622 / Virus Database: 400 - Release Date: 13/03/2004

freebsd-questions at mailing list
To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list