Monday 9 November 2009

find specific files out of lakhs of files

I need to find number of files starting with sa.277 or sa.278 or sa.295 or sa.299 out of a directory which has over 10 lakh files.How can i do that ?

ls won't work here, it will take hell lot of time.This is how we can do:

find . -type f -name "ma.*" | grep "ma.2[97][5978]" | wc -l  

No comments:

Post a Comment

Tweets by @sriramperumalla