[meder@kat directoryName]$ grep -RlI "send you instr" *
application/views/scripts/auth/forgot.phtml
[meder@kat directoryName]$
Is there a quick hack to referencing the only result? Can I somehow pipe it to vim?
[meder@kat directoryName]$ grep -RlI "send you instr" *
application/views/scripts/auth/forgot.phtml
[meder@kat directoryName]$
Is there a quick hack to referencing the only result? Can I somehow pipe it to vim?
Open a new file in vim and insert the found filename as a text:
grep -RlI "send you instr" * | vim -
Open the found file directly in vim:
grep -RlI "send you instr" * | xargs vim
If you're OK with it opening all results in Vim, you could just do:
vim $(grep -RlI "send you instr" *)
You'll be put into a buffer with the first matching file, and can navigate to the others with :next
.
Stand on your head and say, "Open file!" three times. This has not been tested though, so be careful if you use it in a production environment.