finding and editing

July 1st, 2010 § 0 comments

Search for files containing some text, open them in vim (one per tab)

 grep -l foo ./* | xargs vim -p

Alternatively, to get a single-line list that can be edited and then copy-pasted to a command-line:

grep -l foo ./* | xargs echo

There are more heavy-duty ways of removing lines in output listed here, but I see little reason for using them.t

Tagged

Leave a Reply

Your email address will not be published. Required fields are marked *

What's this?

You are currently reading finding and editing at Dan O'Huiginn.

meta