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!

Advertisements

Sr. Software Engineer

Tagged with: , ,
Posted in Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: