Pipe output to use as the search specification for grep on Linux

前端 未结 9 1112
天涯浪人
天涯浪人 2021-02-03 22:12

How do I pipe the output of grep as the search pattern for another grep?

As an example:

grep   | xargs grep          


        
9条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-03 22:47

    This is what I use to search for a file from a listing:

    ls -la | grep 'file-in-which-to-search'
    

提交回复
热议问题