查找删除重复文件的Perl脚本

  • 注意

此程序未经广泛测试,请谨慎使用。

  • 下载

yi.pl

  • 帮助

Name
yi.pl — find (and remove) duplicate files in one directory (or
directories) on *nix system

Description
This program can find duplicate files in a directory or several
directories, and to remove the redundancy files.

Tips: If you want to scan folder(s) including their subfolder(s), please
use “-r” for the recursive mode.

Usage
perl yi.pl [options] <dir1> [dir2] [dir3] …
./yi.pl [options] <dir1> [dir2] [dir3] …

Options
-a|algorithm <str>     Hash algorithm: md5, crc, sha1. [default: md5]
-l|–log <str> Log file. [default: yi.log]
-r|–recursive Recursive mode.
-t|–test      Test mode: get the redundancy information, and do nothing else.
-v|–verbose   Verbose mode: output running progress info_testrmation to the screen.
-h|-?|–help   Output this help info_testrmation to the screen.

Example
perl yi.pl .
perl yi.pl -r . /home/
perl yi.pl -t .
perl yi.pl -t -r -l log.txt /home/

Note
1. “YI” means “DU YI WU ER”, in English, only one.
2. Log file will be created under CURRENT directory, not WORK directory.
3. Redundancy files are removed to TRASH actually, so it’s possible to turn back the clock before reboot.
4. The dir for TRASH is “/tmp/trash” on Linux.

Version
Author: Yixf, yixf1986@gmail.com
Version: beta  Date: 2010-11-13
Version: 0.09  Date: 2010-11-15
Version: 0.1   Date: 2010-11-23
Version: 1.0   Date: 2011-05-22