Reputation: 137
I'm trying to delete all files (include subdir) in a directory but only files which not match specific file name: "equipe" "match" "express"
I'm trying to do it with this command
find . -type f '!' -exec grep -q "equipe" {} \; -exec echo rm {} \;
Upvotes: 1
Views: 561
Reputation: 785068
You may use this find
:
find . -type f -not \( -name '*equipe*' -o -name '*match*' -o -name '*express*' \) -delete
Upvotes: 4