Reputation: 10679
I have several hundred files with file names such as: 20110404_091415-R1-sometext
Another file name might be named: 20110404_091415-R1.2-sometext
What I would like to do is use the Unix grep tool in the terminal to find files that start with 2011 and also contain -R1 within the file name. Unfortunately, I have no idea to find files that satisfy both these criteria. I have tried to figure out a regex that would match this, but I am only a beginner programmer. Can anyone help please? Thanks in advance for your time.
Upvotes: 0
Views: 8635
Reputation: 25599
Just to find files, you can use ls 2011*R1*
or echo 2011*R1*
. To do something to files, use a loop (generally)
for file in 2011*R1*
do
....
done
Upvotes: 0