The following command will show the lines match the pattern.
cat file.txt | select-string -pattern "..."
How to show the previous and after 3 lines each for the matched lines? (Like the -C3
parameter of grep.) Also is it possible to print out the line number?
BTW, the command is much slower comparing with grep?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…