I’ve been using Linux since the mid 1990s. I’m comfortable on the command line However when it comes to grep, I use it…it works. I document it. Later I use it again…it doesn’t work.
For example I documented:
[ON [9/22/2018] THE FOLLOWING WORKS!!!!]
grep “using” -n /home/bill/MyStuff/Python3/*.py < This seems to work best [gives me line/line # and is recursive!]
So today I tried:
grep “pentium2” -n /home/bill/*.* to search ALL my files, and it returned immediately meaning it didn’t recurse
I know it makes sense to use a “-r” flag but I wouldn’t have documented it that way if it didn’t work
Also that’s not the only example I documented with a date.
I also documented this grep -i -r -n –include *.txt “string” > grep.log which worked at one time
Today it seems like this works:
grep -i -r -n "PENTIUM" .
which makes sense. The last dot “.” means recurse starting from here. The -i ignores case. The -n displays the line number. But probably won’t work in the future.
Actually the above command didn’t work (at first) when I copied it to verify it works. Because I didn’t initially copy it into a WordPress code block, and WordPress changed the double quotes.
Oh and if you want to search for “mimesis” in the Python directory don’t search for “*mimesis*”, unless you use the ‘-E’ switch.
Somehow it won’t work in the future. Then I’ll google it and see multiple examples with switches and slashes and magic dust.