bash delete all files of type recursively
# print all files recursively with exstension .bak
find . -name "*.bak" -type f
# add -delete command at the end to delete them
find . -name "*.bak" -type f -delete
bash delete all files of type recursively
# print all files recursively with exstension .bak
find . -name "*.bak" -type f
# add -delete command at the end to delete them
find . -name "*.bak" -type f -delete
bash remove all files in directory except a few
## Ensure you enable this first!
shopt -s extglob
## Delete all file except file1 ##
rm !(file1)
## Delete all file except file1 and file2 ##
rm !(file1|file2)
## Delete all file except all zip files ##
rm !(*.zip)
## Delete all file except all zip and iso files ##
rm !(*.zip|*.iso)
## You set full path too ##
rm /Users/vivek/!(*.zip|*.iso|*.mp3)
## Pass options ##
rm [options] !(*.zip|*.iso)
rm -v !(*.zip|*.iso)
rm -f !(*.zip|*.iso)
rm -v -i !(*.php)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us