Can you mass edit all files returned in a grep?

后端 未结 6 2068
失恋的感觉
失恋的感觉 2020-12-24 04:35

I want to mass-edit a ton of files that are returned in a grep. (I know, I should get better at sed).

So if I do:

grep -rnI \'xg_icon-*\'
         


        
6条回答
  •  暖寄归人
    2020-12-24 05:42

    You can do it without any processing of the grep output! This will even enable you to go the the right line (using :help quickfix commands, eg. :cn or :cw). So, if you are using bash or zsh:

    vim -q <(grep foo *.c)
    

提交回复
热议问题