Reputation: 186692
[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?
Upvotes: 3
Views: 354
Reputation: 333136
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
.
Upvotes: 4
Reputation: 213045
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
Upvotes: 3