Tip: remove all files except given with shell command

shopt -s extglob
rm -rf !(file.txt)

Leave a Reply

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