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
本文介绍如何使用grep命令从搜索结果中排除包含特定子串的条目。通过实例演示了如何查找包含'wireshark'但不包含'unimous'的所有文件,并使用这些结果进行批量删除操作。
714

被折叠的 条评论
为什么被折叠?



