Delete everything multiple files Linux

If you want to find and delete some files from your drive then use this command:

find . -type f ! \( -name "*thumb.jpg" -o -name "*1200w.jpg" \) -exec rm -rf {} \;

Explanation: https://unix.stackexchange.com/questions/78376/in-linux-how-to-delete-all-files-except-the-pattern-txt

https://unix.stackexchange.com/questions/50612/how-to-combine-2-name-conditions-in-find

Leave a Reply

Your email address will not be published. Required fields are marked *