I have a folder with huge number of files.
I want to delete the following files from the folder.
ni_mayb17000.mol2
ni_mayb50000.mol2
ni_fda.mol2
ni_mayb2000.mol2
ni_mayb5000.mol2
ni_in_trials1000_2999.mol2
ni_in_trials1-999.mol2
ni_in_trials5000.mol2
ni_intrials8000.mol2
ni_intrialsfinal.mol2
ni_mayb13000.mol2
ni_mayb21000.mol2
ni_mayb45000.mol2
ni_mayb55000.mol2
ni_mayb25000.mol2
ni_mayb60000.mol2
ni_mayb30000.mol2
ni_mayb8000.mol2
ni_mayb35000.mol2
ni_mayb_f.mol2
ni_mayb40000.mol2
ni_world_not_fda.mol2
The files which need to be deleted does not follow a particular pattern, so I was not able to use wild card or pattern. Also if I use patterns, I have risk of deleting unintended files. Since I know the exact file name to be deleted, I was planning to store the required files as a list and then delete it using a for
loop
for i in $list; do
rm $i -f;
done
How to store this as a list and then do this for
list?