To open files found with grep in Sublime Text, run the following command subl $(grep -irl “search for text” .) Where i = case insensitive r = recursive l = only file names Be sure to include the l flag, otherwise you’ll open a bunch of new files with no relation to what you’re […]
Tag: search
Grep list only unique filenames
To list unique filenames using grep, do the following: grep -irl “search-term” . Notice the ‘l’ flag, short for –files-with-matches, defined as “Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match.” The i flag just makes […]