How to grep for an exact phrase
I'm running a script (not mine) that outputs many files of the form:
FileName.1234567 (where the numerical part is some random number) In most cases it's easy to grep out a certain filename, since they're not similar, but I'm running into the following problem with similar filenames I'm trying to grep out certain filenames, eg. stat.123456, but unfortunately I get other output that has the word stat in it. How can I do an exact grep to discard matches like Newstat.123456, stationary.123456 etc I've been using the following command ./SomeScript.sh | grep "stat" |
Code:
man grep |
Quote:
|
By means of extended regular expressions (option -E)
Code:
grep -Ew 'stat|station' |
Quote:
|
All times are GMT -5. The time now is 05:47 PM. |