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?
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).
\rm -f you can use \rm -i and that will show each and every file to you and ask for confirmation before removing.As a bash one liner
cat yourfile.txt |while read line; do rm ${line}; done
rm: cannot lstat 6td2h4mk.jpg': No such file or directory` for all of them specified to their file names