How delete a specific type of files from a directory/sub-directory using a single linux command?

Hello Everyone!
If you want to remove the specific type of files from a directory/sub-directory using a single linux command, then just copy and paste my command code and before execute the command update the file suffix

find . -type f -iname *file-suffix -exec rm -r {} \;

Example:
For a example if you want delete to all the files that have suffix .db (abc.db files) then just change the file suffix from the code and execute the command.

find . -type f -iname *.db -exec rm -r {} \;

Enjoy Code!

Leave a Reply

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