Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Delete Files Batch Script

I have a list of file names of files i need to delete.

Is there a way to write a batch file that i can specify Linux to delete these files with the given names?

like image 610
soniccool Avatar asked Jul 20 '26 21:07

soniccool


1 Answers

You can simply call:

\rm -f $(<file.txt)

To remove all the files listed in a file called file.txt (1 per line of course).

like image 178
anubhava Avatar answered Jul 22 '26 10:07

anubhava