Why no output is shown when using grep twice?

后端 未结 5 855
心在旅途
心在旅途 2020-12-02 16:46

Basically I\'m wondering why this doesn\'t output anything:

tail --follow=name file.txt | grep something | grep something_else 

You can ass

5条回答
  •  天涯浪人
    2020-12-02 17:36

    You do know that tail starts by default with the last ten lines of the file? My guess is everything the cat version found is well into the past. Try tail -n+1 --follow=name file.txt to start from the beginning of the file.

提交回复
热议问题