[linux] How to grep a string that do no cantain another substring?

How to grep a string that do no cantain another substring?

There is the solution:

$ ls | grep -ivE 'unimous'

Here is a practical example of using it. If you want to find all the files with names containing 'wireshark' and without 'unimous', and then delete all of them:

$ sudo updatedb
$ locate wireshark | grep -viE 'unimous' | xargs sudo rm -rf
posted @ 2012-10-20 10:20  UniMouS  阅读(315)  评论(0编辑  收藏  举报

版权所有 © 2011-2012 方一曙

Copyright © 2011-2012 Fang Yishu (UniMouS)