Delete files per name in Linux

Do you need to delete files with the same name in linux? You are in the right place

How to delete files from server linux knowing file name

I had this scenario: lot of files to be deleted (about 2-3 hundred), all the files have the same name but stored in different directory (they were rrd files for interface monitoring).

To delete all file just using one command you need to execute the following command from the main directory in which you want to start to delete:

Be careful because it doesn’t ask confirmation before deleting so to be honest with you before doing it.

It is better to check the list of the files using:

 

 

 

Leave a Reply

Your email address will not be published.