mirror of
https://github.com/kevinveenbirkenbach/duplicate-file-handler.git
synced 2024-11-14 18:11:03 +01:00
Deleted old scripts
This commit is contained in:
parent
53b1d8d0fa
commit
f854e46511
@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Directory path not provided"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dir="$1"
|
||||
duplicates=$(find "$dir" -type f -exec md5sum {} + | sort | uniq -d -w32)
|
||||
|
||||
if [ -z "$duplicates" ]
|
||||
then
|
||||
echo "No duplicates found."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Duplicates found:"
|
||||
|
||||
echo "$duplicates" | while read line
|
||||
do
|
||||
files=$(grep "$line" <<< "$duplicates" | awk '{print $2}')
|
||||
file_type=$(file -b --mime-type "${files[0]}")
|
||||
if [[ $file_type == text/* ]]
|
||||
then
|
||||
diff "${files[@]}"
|
||||
else
|
||||
echo "$files"
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue
Block a user