[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的更多相关文章

  1. Python-对比两个目录中Excel文件

    背景:我在5月20日收到了一批Excel文件数据,由于文件很多大约有将近5000个,已经通过编写python脚本处理完成.但是6月9日的时候,又收到了一批新的Excel数据.但是在处理过程中发现,本次 ...

  2. find - 递归地在层次目录中处理文件

    总览 SYNOPSIS find [path...] [expression] 描述 DESCRIPTION 这个文档是GNU版本 find 命令的使用手册. find 搜索目录树上的每一个文件名,它 ...

  3. Linux find命令:在目录中查找文件(超详解)

    find 是 Linux 中强大的搜索命令,不仅可以按照文件名搜索文件,还可以按照权限.大小.时间.inode 号等来搜索文件.但是 find 命令是直接在硬盘中进行搜索的,如果指定的搜索范围过大,f ...

  4. python glob 用通配符查找指定目录中的文件 - 开源中国社区

    python glob 用通配符查找指定目录中的文件 - 开源中国社区 python glob 用通配符查找指定目录中的文件

  5. Linux查看目录中的文件

    Linux查看目录中的文件 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ ls examples.desktop jdk 公共的 视频 文档 音乐 java ...

  6. File类之在指定目录中查找文件

    package IoDemo; import java.io.File; /** * @Title:FileDemo2 * @Description:在指定的目录中查找文件 * @author Cra ...

  7. 使用Parallel计算目录中的文件字节长度

    /// <summary> /// 根据通配符和搜索条件计算给定目录中的文件字节长度 /// </summary> /// <param name="path& ...

  8. linux中/etc与/var目录,各是什么意思?这两个目录下的文件有什么特点?

    http://zhidao.baidu.com/link?url=DkxU9CyhJb_dIUAPCmPmxRtQsENgCzqy5qnLPEj_V9DqNzdt6Qya0U5iCVRCYFkgoRo ...

  9. Python 对目录中的文件进行批量转码(GBK>UTF8)

    通过python实现对文件转码,其实处理很简单: 1.打开读取文件内容到一个字符串变量中,把gbk编码文件,对字符串进行decode转换成unicode 2.然后使用encode转换成utf-8格式. ...

随机推荐

  1. Redis 集合操作

    1.SCARD key 返回集合 key 的基数(集合中元素的数量). 2.SDIFFSTORE destination key [key ...] 这个命令的作用和  类似,但它将结果保存到 des ...

  2. Core Animation编程指南

    本文是<Core Animation Programming Guide>2013-01-28更新版本的译文.本文略去了原文中关于OS X平台上Core Animation相关内容.因为原 ...

  3. Spring学习3—控制反转(IOC)Spring依赖注入(DI)和控制反转(IOC)

    一.思想理解 Spring 能有效地组织J2EE应用各层的对象.不管是控制层的Action对象,还是业务层的Service对象,还是持久层的DAO对象,都可在Spring的 管理下有机地协调.运行.S ...

  4. iconv命令详解

    功能]  对于给定文件把它的内容从一种编码转换成另一种编码. [描述]  -f encoding :把字符从encoding编码开始转换. -t encoding :把字符转换到encoding编码. ...

  5. 汇文Libsys图书管理系统全版本权限绕过+getshell

    由于一个很低级的代码错误,导致可以登录Libsys任意图书系统后台,并且由于代码未做过滤可直接getshell. 该图书管理系统的用户量很大,全国很大一部分院校都在使用此系统.经测试3.5-5.0版本 ...

  6. mouseover和mouseout闪烁问题

    在父级元素上注册了mouseover和mouseout事件后,当鼠标移动到子元素上时,会触发父级的mouseout和mouseover事件,反复触发,形成闪烁. 原因: 一种是由于冒泡,子级的mous ...

  7. java开发微信公众平台备忘

    简单记录下前段时间开发的电子书的 公众平台的一些备忘及开发心得经验等 eclipse的一些技巧: 1.ctrl+shift+o 自动添加必要import空间及移除无用import 项目备忘+说明 1. ...

  8. JavaScriptSerializer中日期序列化问题解决方案

    JavaScriptSerializer中日期序列化问题解决方案 直接进入主题: class Student { public int age { get; set; } public DateTim ...

  9. js中查找一个字符是否存在。

    <script> var a = 'd'; var re = a.indexOf('d'); ){ alert('存在'); } else { alert('不存在'); } </s ...

  10. 记一个奇怪的python异常处理过程

    我的一个程序, 总是在退出时报异常, Exception TypeError: "'NoneType' object is not callable" in <functio ...