Grep expressions c
I am facing problem with getting regular expression for grep for these patterns:-
1).what words c开发者_Python百科ontain but do not begin with the string 'ps'.
2)What option has a description with the words "hide entries". (next line that contains some text after specified word.
I googled but didnt find it. Any suggestions will be appreciated. Thanks
As grep deals with lines, you must process the source to have each word on its own line, then grep. If efficiency is not a question you can
grep "ps"
and pipe it togrep -v "^ps"
.I don't understand about hiding the entries. Can you provide an example of what you need from this option?
You could also use grep -P '^(?!ps)'
.
精彩评论