msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

13 Nov 2012 Script to delete files listed in a file

Posted by

This is a short one liner bash script to delete files in a file.
The script also handles filenames with space in them.


$ while read file; do rm "$file"; done < filename.txt

To generate a filename.txt file by searching for a specific pattern you can use the following command

$ find / -type f -name "filname*" > filename.txt

You should verify the files you are about to delete before you invoke this script!

Tags: ,

Comments are closed.