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