[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. Bootstrap Modals(模态框)

    http://www.runoob.com/bootstrap/bootstrap-v2-modal-plugin.html 描述 Bootstrap Modals(模态框)是使用定制的 Jquery ...

  2. 求三数中Max和猜拳游戏

    方法一: Console.WriteLine("请输入三个数字:"); int a = int.Parse(Console.ReadLine()); int b = int.Par ...

  3. UVa OJ 180 - Eeny Meeny

    Time limit: 3.000 seconds限时3.000秒 Problem问题 In darkest <name of continent/island deleted to preve ...

  4. Unable to open liblaunch_sim.dylib. Try reinstalling Xcode or the simulator

    关于Xcode7 Beta报错 simulator runtime is not available. Unable to open liblaunch_sim.dylib Try reinstall ...

  5. codejumper的跳转代码

    public void JumpToSource(vsCMPart location = vsCMPart.vsCMPartNavigate) { TextPoint startPoint = Ori ...

  6. 通过ajax访问aspx的CodeBehind中的方法

    引言 在项目中突然看到,aspx中的ajax可以访问aspx.cs中的方法,觉得很新奇,也许是lz少见多怪,不过,真的有发现新大陆似的那种兴奋,你也许知道这代表什么,学会了这种方式,代表你以后,可以建 ...

  7. gvim设置成不备份文件

    打开gVim,进入“编辑”-“启动设定” 在“behave mswin”下行位置添加 set nobackup 语句 退出并保存配置文件 :wq

  8. 读>>>>白帽子讲Web安全<<<<摘要→我推荐的一本书→1

      <白帽子讲Web安全>吴翰清著 刚开始看这本书就被这本书吸引,感觉挺不错,给大家推荐下,最近读这本书,感觉不错的精华就记录下, 俗话说>>>好脑袋不如一个烂笔头< ...

  9. Open Credit System

    Open Credit SystemInput: Standard Input Output: Standard Output In an open credit system, the studen ...

  10. Iphone和iPad适配, 横竖屏

    竖屏情况下: [UIScreen mainScreen].bounds.size.width = 320 [UIScreen mainScreen].bounds.size.width = 568 横 ...