比较两个目录中的文件 diff -rq
[root@bass test]# mkdir A B
[root@bass test]# tree A
A
└── lin 0 directories, 1 file
[root@bass test]# tree B
B
└── lin 0 directories, 1 file
[root@bass test]# echo "hello A" > A/lin
[root@bass test]# echo "hello B" > B/lin
[root@bass test]# diff -rq A B
Files A/lin and B/lin differ
[root@bass test]# echo "hello A" > B/lin
[root@bass test]# diff -rq A B
[root@bass test]#
[root@bass test]# mkdir A/a
[root@bass test]# mkdir B/b
[root@bass test]# diff -rql A B
Only in A: a
Only in B: b
Files A/lin and B/lin differ
[root@bass test]# diff -rql A B
Only in A: a
Only in B: b
Files A/lin and B/lin differ
[root@bass test]# ls
A B
[root@bass test]# mv A/a/ A/x
[root@bass test]# tree A
A
├── lin
└── x 1 directory, 1 file
[root@bass test]# mv B/b B/x
[root@bass test]# tree B
B
├── lin
└── x 1 directory, 1 file
[root@bass test]# diff -rq A B
Files A/lin and B/lin differ
[root@bass test]# cat A/lin
hello A
[root@bass test]# cat B/lin
hello B
[root@bass test]# touch A/x/chen
[root@bass test]# touch B/x/chen
[root@bass test]# diff -rq A B
Files A/lin and B/lin differ
[root@bass test]# echo "hello chen" > A/x/chen
[root@bass test]# echo "hello chen" > B/x/lin
[root@bass test]# diff -rq A B
Files A/lin and B/lin differ
Files A/x/chen and B/x/chen differ
Only in B/x: lin
比较两个目录中的文件 diff -rq的更多相关文章
- Python-对比两个目录中Excel文件
背景:我在5月20日收到了一批Excel文件数据,由于文件很多大约有将近5000个,已经通过编写python脚本处理完成.但是6月9日的时候,又收到了一批新的Excel数据.但是在处理过程中发现,本次 ...
- find - 递归地在层次目录中处理文件
总览 SYNOPSIS find [path...] [expression] 描述 DESCRIPTION 这个文档是GNU版本 find 命令的使用手册. find 搜索目录树上的每一个文件名,它 ...
- Linux find命令:在目录中查找文件(超详解)
find 是 Linux 中强大的搜索命令,不仅可以按照文件名搜索文件,还可以按照权限.大小.时间.inode 号等来搜索文件.但是 find 命令是直接在硬盘中进行搜索的,如果指定的搜索范围过大,f ...
- python glob 用通配符查找指定目录中的文件 - 开源中国社区
python glob 用通配符查找指定目录中的文件 - 开源中国社区 python glob 用通配符查找指定目录中的文件
- Linux查看目录中的文件
Linux查看目录中的文件 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ ls examples.desktop jdk 公共的 视频 文档 音乐 java ...
- File类之在指定目录中查找文件
package IoDemo; import java.io.File; /** * @Title:FileDemo2 * @Description:在指定的目录中查找文件 * @author Cra ...
- 使用Parallel计算目录中的文件字节长度
/// <summary> /// 根据通配符和搜索条件计算给定目录中的文件字节长度 /// </summary> /// <param name="path& ...
- linux中/etc与/var目录,各是什么意思?这两个目录下的文件有什么特点?
http://zhidao.baidu.com/link?url=DkxU9CyhJb_dIUAPCmPmxRtQsENgCzqy5qnLPEj_V9DqNzdt6Qya0U5iCVRCYFkgoRo ...
- Python 对目录中的文件进行批量转码(GBK>UTF8)
通过python实现对文件转码,其实处理很简单: 1.打开读取文件内容到一个字符串变量中,把gbk编码文件,对字符串进行decode转换成unicode 2.然后使用encode转换成utf-8格式. ...
随机推荐
- AngularJS 的数据绑定
单向绑定(ng-bind) 和 双向绑定(ng-model) 的区别 ng-bind 单向数据绑定($scope -> view),用于数据显示,简写形式是 {{}}. 1 <span n ...
- 如何获取xcassets中LaunchImage图片
NSDictionary * dic = @{@"320x480" : @"LaunchImage-700", @"320x568" : @ ...
- 锋利的jQuery-3--.css()获取和设置元素的数字属性
$('p').css({"fontSize": "30px", "backgroundColor": "#666"}); ...
- linux:SUID、SGID详解
linux:SUID.SGID详解 文章转载至:http://tech.ccidnet.com/art/2583/20071030/1258885_1.html 如果你对SUID.SGID仍有迷惑可以 ...
- Visual Studio Online Integrations-Productivity
原文:http://www.visualstudio.com/zh-cn/explore/vso-integrations-di ...
- ftp (文件传输协议)
ftp (文件传输协议) 锁定 本词条由“科普中国”百科科学词条编写与应用工作项目 审核 . FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为“文传协议” ...
- 王垠:完全用Linux工作
来自: Zentaur(alles klar) 录一篇旧文 作者:王垠 完全用Linux工作,抛弃windows 我已经半年没有使用 Windows 的方式工作了.Linux 高效的完成了我所有的工作 ...
- git配置global信息
git 执行提交时,提示用户输入用户和邮箱 git commit -m '*add newCat file' newCat/ *** Please tell me who you are. Run g ...
- Hadoop日记Day1---Hadoop介绍
一.Hadoop项目简介 1. Hadoop是什么 Hadoop是一个适合大数据的分布式存储与计算平台. 作者:Doug Cutting:Lucene,Nutch. 受Google三篇论文的启发 2. ...
- 21个常用的PHP代码汇总
PHP 是目前使用最广泛的基于 Web 的编程语言,驱动着数以百万计的网站,其中也包括如 Facebook 等一些大型站点.这里收集了 21个日常开发中实用便捷的 PHP 代码,希望可以对一些 PHP ...