Created
February 23, 2023 15:45
-
-
Save romansavrulin/4cc5f86621a95ecedd3675456079fd0e to your computer and use it in GitHub Desktop.
Remove files by md5 sum list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cut -f 2- -d ' ' md5.sum > file.list | |
input="file.list" | |
###################################### | |
# $IFS removed to allow the trimming #. | |
##################################### | |
while read -r line | |
do | |
file=$(echo $line | awk 'sub(/ *$/, "", $0)') | |
[ -f "$file" ] && rm "$file" | |
done < "$input" | |
rm "$input" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment