I have csv files in directories with this structure:
20090120/
20090121/
20090122/
etc...
I want to grep for a certain string in all of the csv files in these directories, but only for January 2009, e.g. 200901*/*.csv
Is there a bash command line argument that can do this?
To include all subdirectories in a search, add the -r operator to the grep command. This command prints the matches for all files in the current directory, subdirectories, and the exact path with the filename. In the example below, we also added the -w operator to show whole words, but the output form is the same.
You can use grep command or find command as follows to search all files for a string or words recursively.
Yes. grep "a certain string" 200901*/*.csv
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With