Linux grep command

grep filter search, pipe symbol: "|", which means that the output of the processing result of the previous command is passed to the subsequent command processing

-n Display line number, -i ignore case.
Find yes in hello.txt to
cat hello.tex | grep yes
display line number.
cat hello.tex | grep -n yes
Display line number and ignore daxiaoxie
cat hello.txt | grep -ni yes

Published 48 original articles · Likes0 · Visits 282

Guess you like

Origin blog.csdn.net/qq_44971387/article/details/105329839