欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

查看: 7457|回复: 0
收起左侧

[编程] 基于md5的重复文件查找

[复制链接]
[tex=code]#!/bin/bash

# Usage:
# History:
#
set -x
rm -f file.list
touch file.list

find ./ >allfile.list

while read file
do
if [ ! -f "file"];thencontinuefiMD5=md5sum"file" | awk '{print 1}'` 
 DUPLICATION=`grep
MD5 file.list | awk -F '[|]' '{print 1}'` 
 grep
MD5 file.list && r=0 || r=1
if [ req1];thenecho"file  | MD5">>file.listelseecho"file | MD5>duplicationwithDUPLICATION" >>file.list
  rm -f "$file"
fi
done <allfile.list

grep duplication file.list >duplication.list[/tex]
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

客服QQ936487697|联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2025-5-1 07:53 , Processed in 0.038957 second(s), 10 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表