Grep for String and open at the corresponding line

前端 未结 3 1321
死守一世寂寞
死守一世寂寞 2021-01-21 05:58

I\'m having several occurrences of a specific string over several files in several lines obtained with grep.

$ grep -rn --include=\"*.cpp\" mystring         


        
3条回答
  •  自闭症患者
    2021-01-21 06:28

    Here is another way to do

    $ grep -rn --include="*.cpp" mystring > op
    $ vim op
    

    Then use gF and to come back to file op, use Ctrl + 6

提交回复
热议问题