文件对比
来源:互联网 发布:淘宝评价照片怎么删除 编辑:程序博客网 时间:2024/05/02 16:54
文件差异、相似度对比,经常用到,在此做一个总结
Google: Linux md5 compare sub directories
md5sum
find./rips-0.54/ -type f -print0 | xargs -0 md5sum
md5sum -cfile.md5
md5sum -c file.md5 | grep FAILED$ >failed_hashes
md5sum -c file.md5 | grep -v OK$ >failed_hashes
md5deep
http://sourceforge.net/projects/md5deep/
ssdeep
$ cd/data/src/
$ wgethttp://downloads.sourceforge.net/project/ssdeep/ssdeep-2.10/ssdeep-2.10.tar.gz
$tar xzvf ssdeep-2.9.tar.gz
$ cd ssdeep-2.9/
$ ./configure
$make
$ sudo make install
$ ssdeep-h
ssdeep version 2.10 by Jesse Kornblum
Copyright (C) 2013Facebook
Usage: ssdeep [-m file] [-k file] [-dpgvrsblcxa][-t val] [-h|-V] [FILES]
-m - Match FILES against known hashesin file
-k - Match signatures in FILES against signatures infile
-d - Directory mode, compare all files in a directory
-p- Pretty matching mode. Similar to -d but includes all matches
-g- Cluster matches together
-v - Verbose mode. Displays filenameas its being processed
-r - Recursive mode
-s - Silent mode;all errors are supressed
-b - Uses only the bare name of files;all path information omitted
-l - Uses relative paths forfilenames
-c - Prints output in CSV format
-x - CompareFILES as signature files
-a - Display all matches, regardlessof score
-t - Only displays matches above the giventhreshold
-h - Display this help message
-V - Displayversion number and exit
diff
diff -q -r./rips-0.54/ ./rips-0.541/
rsync
rsync -lrthvcn--delete /home/source/dir /home/destination/dir
GREP
root@gnu:~#cat 11.txt
1
2
3
a
c
root@gnu:~# cat 22.txt
a
b
c
2
3
root@gnu:~# grep -Fxvf 11.txt 22.txt
b
root@gnu:~# grep -Fxvf 22.txt 11.txt
1
comm -13<(sort file1) <(sort file2) > file
diff file1 file2 >file3
join -v 2 <(sort file1) <(sort file2) > file3
参考
http://www.linuxquestions.org/questions/linux-software-2/how-to-create-md5sum-for-a-directory-689242/
http://stackoverflow.com/questions/9473552/how-to-compare-two-directories-subdirectories-while-ignoring-certain-directory-n
http://www.aldeid.com/wiki/Ssdeep
- 文件对比
- 两个文件对比 C#
- 文件对比工具
- 文件对比工具
- 文件内容对比
- vi对比两个文件
- java文件对比工具
- 两个数据库文件对比
- 文件的路径对比
- 文件内容差异对比
- 缓存文件对比
- shell文件对比
- 文件缓冲输入输出对比
- 文件对比工具
- 文件存储方案对比
- smali文件对比java文件
- smali文件对比java文件
- smali文件对比java文件
- pip 与 virtualenv 的使用
- 学习运行简单的mapreduce计算
- 无Device的驱动如何通信
- Linux中grep命令的12个实践例子
- 随心所语之“读书”
- 文件对比
- 使用phpass对密码进行加密安全度比md5高
- 新浪微博客户端开发之发布微博
- plsql从入门到精通
- 视频背景差分检测
- 在linux下,完全杀死tomcat等进程脚本
- POJ1741 Tree dp+树的点分治(楼天成推荐男人必做八题之一)
- Java NIO Tutorial 1- Introduction
- C基础概念