linux:files:delete_files_listed_in_a_file
Linux - Files - Delete files listed in a file
A 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
Generate a search file
To generate a filename.txt file by searching for a specific pattern:
find / -type f -name "filname*" > filename.txt
WARNING: Verify the files that are to be deleted before invoking this script!
linux/files/delete_files_listed_in_a_file.txt · Last modified: 2023/07/17 18:49 by peter