When using sudo rm -r, how can I delete all files, with the exception of the following:
sudo rm -r
textfile.txt backup.tar.gz script.php database.sql info.
This is similar to the comment from @siwei-shen but you need the -o flag to do multiple patterns. The -o flag stands for 'or'
-o
find . -type f -not -name '*ignore1' -o -not -name '*ignore2' | xargs rm