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.
Rather than going for a direct command, please move required files to temp dir outside current dir. Then delete all files using rm * or rm -r *.
rm *
rm -r *
Then move required files to current dir.