How can I remove all in folder and exclude specific folders and files?
(As example with tar: tar --exclude="folder"
).
Edit: I can delete files and folders.
NOTE: Be careful running the following commands.
find . -type 'f' | grep -v "NameToExclude" | xargs rm
find . -type 'd' | grep -v "NameToExclude" | xargs rmdir
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With