#!/bin/bash ls -lS | awk ‘BEGIN{ getline; getline; name1=$9;size=$5; } { name2=$9; sizeTmp=$5; if(size==$5){ "md5sum "name1 | getline; csum1=$1; "md5sum "name2 | getline; csum2=$1; if(csum1=csum2){ print name1; print name2; } } size=sizeTmp; name1=name2; } ‘ | sort -u > dup_file cat dup_file | xargs -i md5sum {} | sort -u | uniq -w 32 | cut -d ‘ ‘ -f3 > dup_save; comm ./dup_file ./dup_sample -2 -3 | xargs rm -f
时间: 2024-10-26 13:03:14