I noticed that I’ve been using grep a lot lately to search for text in a directory. I find myself using the same options every time as well:
1
| |
Just to be clear, --color highlights the search string in the output, -i makes the search case-insensitive, -r makes the search recursive, -n outputs the line number of the hit, and the . at the end says to search the current directory. Lazy as I am, I realized I could just add this to ~/.bash_profile:
1
| |
Now, I can save some time and thought with ggrep "thing" . It’s the little things…
EDIT: As Matt Turk suggests in the comments, the best alternative (especially for the Pythonists) is grin. Much simpler and clearer display of results.