Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count Files in Directory Matching name pattern

Status
Not open for further replies.

saw15

Technical User
Jan 24, 2001
468
US
I need to count the number of files that are select when using the following command: ls -l *.20021001.*

There are literally thousands of files, and I need to know the specific number of files matching this criteria.

Any help is much appreciated.
 
Hi,

Try "ls -l|grep *.....*|wc -l" this should give you a count of the matching files.

Hope this helps.

Ray
 
about a million ways to do this one.

ls -l *.20021001.* |wc -l

ls -l|egrep -c 20021001




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top