开发者

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


  1. 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 to grep -v "^ps".

  2. 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)'.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜