Reputation: 579
so I'm trying to use bash to find all files above 500MB. I have been able to accomplish this using find ~ size +500M
.
However, the output contains a lot of python library files that aren't relevant to my search. So how do I adjust this command (using bash or grep or awk) so that it excludes certain directories (for example /webapps/lib/python2.7/) Thanks for the help in advance, everyone.
Upvotes: 1
Views: 1555
Reputation: 20456
You can use path
with negation. For example, the following command will exclude results whose path start with "~/path1" or "~/path2"
find ~ size +500M ! -path "~/path1/*" ! -path "~/path2/*"
Upvotes: 1