当前位置:  技术问答>linux和unix

diff命令的问题

    来源: 互联网  发布时间:2016-10-29

    本文导语:  现有两个文件 a ,b a中内容为: BSC941535.98.201010241400.287038##/home/mos5200/yeliang/NOKIA 08:25 657 BSC941535.98.201010241500.288850##/home/mos5200/yeliang/NOKIA 08:25 660 BSC941535.98.201010241600.290179##/home/mos5200/yeliang/NOKIA 08:25 660 BSC941535.98.2010102...

现有两个文件 a ,b
a中内容为:
BSC941535.98.201010241400.287038##/home/mos5200/yeliang/NOKIA 08:25 657
BSC941535.98.201010241500.288850##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010241600.290179##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010242300.301319##/home/mos5200/yeliang/NOKIA 08:25 658
BSC941535.98.201010250200.305522##/home/mos5200/yeliang/NOKIA 08:25 659
BSC941535.98.201010250300.306964##/home/mos5200/yeliang/NOKIA 08:25 659
BSC941535.98.201010250400.308513##/home/mos5200/yeliang/NOKIA 08:25 659
BSC941535.98.201010250500.310045##/home/mos5200/yeliang/NOKIA 08:25 659
BSC941535.98.201010250600.311543##/home/mos5200/yeliang/NOKIA 08:25 659

b中内容为:
BSC941535.98.201010241400.287038##/home/mos5200/yeliang/NOKIA 08:25 657
BSC941535.98.201010242300.301319##/home/mos5200/yeliang/NOKIA 08:25 658
BSC941535.98.201010250200.305522##/home/mos5200/yeliang/NOKIA 08:25 659
BSC941535.98.201010250300.306964##/home/mos5200/yeliang/NOKIA 08:25 659
BSC941535.98.201010250400.308513##/home/mos5200/yeliang/NOKIA 08:25 659
BSC941535.98.201010250500.310045##/home/mos5200/yeliang/NOKIA 08:25 659
BSC941535.98.201010250600.311543##/home/mos5200/yeliang/NOKIA 08:25 659
BSC941535.98.201010241500.288850##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010241600.290179##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010241700.292190##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010250100.303949##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010250700.313032##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010250800.314910##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010250900.316100##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010241800.293259##/home/mos5200/yeliang/NOKIA 08:25 661
BSC941535.98.201010241900.294751##/home/mos5200/yeliang/NOKIA 08:25 661
BSC941535.98.201010242000.296252##/home/mos5200/yeliang/NOKIA 08:25 661
BSC941535.98.201010242100.297775##/home/mos5200/yeliang/NOKIA 08:25 661
BSC941535.98.201010242200.299337##/home/mos5200/yeliang/NOKIA 08:25 661
BSC941535.98.201010250000.302477##/home/mos5200/yeliang/NOKIA 08:25 661
BSC941535.97.201010250400.308481##/home/mos5200/yeliang/NOKIA 08:25 339042
BSC941535.97.201010250500.310059##/home/mos5200/yeliang/NOKIA 08:25 342204
BSC941535.97.201010250600.311541##/home/mos5200/yeliang/NOKIA 08:25 347133
BSC941535.97.201010250300.306962##/home/mos5200/yeliang/NOKIA 08:25 353222
BSC941535.97.201010250200.305521##/home/mos5200/yeliang/NOKIA 08:25 356565
BSC941535.97.201010250700.313030##/home/mos5200/yeliang/NOKIA 08:25 361153
BSC941535.97.201010250800.314577##/home/mos5200/yeliang/NOKIA 08:25 375376
BSC941535.97.201010250900.316098##/home/mos5200/yeliang/NOKIA 08:25 378543

其中两个文件中均含有
BSC941535.98.201010241500.288850##/home/mos5200/yeliang/NOKIA 08:25 660
BSC941535.98.201010241600.290179##/home/mos5200/yeliang/NOKIA 08:25 660

使用diff 命令后,这两个文件是作为不同的记录出现的,即:
2,3d1
 BSC941535.98.201010241600.290179##/home/mos5200/yeliang/NOKIA 08:25 660
> BSC941535.98.201010241700.292190##/home/mos5200/yeliang/NOKIA 08:25 660
> BSC941535.98.201010250100.303949##/home/mos5200/yeliang/NOKIA 08:25 660
> BSC941535.98.201010250700.313032##/home/mos5200/yeliang/NOKIA 08:25 660
> BSC941535.98.201010250800.314910##/home/mos5200/yeliang/NOKIA 08:25 660
> BSC941535.98.201010250900.316100##/home/mos5200/yeliang/NOKIA 08:25 660
> BSC941535.98.201010241800.293259##/home/mos5200/yeliang/NOKIA 08:25 661
> BSC941535.98.201010241900.294751##/home/mos5200/yeliang/NOKIA 08:25 661
> BSC941535.98.201010242000.296252##/home/mos5200/yeliang/NOKIA 08:25 661
> BSC941535.98.201010242100.297775##/home/mos5200/yeliang/NOKIA 08:25 661
> BSC941535.98.201010242200.299337##/home/mos5200/yeliang/NOKIA 08:25 661
> BSC941535.98.201010250000.302477##/home/mos5200/yeliang/NOKIA 08:25 661
> BSC941535.97.201010250400.308481##/home/mos5200/yeliang/NOKIA 08:25 339042
> BSC941535.97.201010250500.310059##/home/mos5200/yeliang/NOKIA 08:25 342204
> BSC941535.97.201010250600.311541##/home/mos5200/yeliang/NOKIA 08:25 347133
> BSC941535.97.201010250300.306962##/home/mos5200/yeliang/NOKIA 08:25 353222
> BSC941535.97.201010250200.305521##/home/mos5200/yeliang/NOKIA 08:25 356565
> BSC941535.97.201010250700.313030##/home/mos5200/yeliang/NOKIA 08:25 361153
> BSC941535.97.201010250800.314577##/home/mos5200/yeliang/NOKIA 08:25 375376
> BSC941535.97.201010250900.316098##/home/mos5200/yeliang/NOKIA 08:25 378543
明显不对 可是不知道为什么 哪位帮帮忙

|
这就是diff的行为 只不过你一开始误解了而已

|
diff 比较难用。一般跟patch组合使用。
反正我是很少用啊。

    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 100分请教如何用diff生成patch
  • 处理一下diff的结果
  • (在线等)diff扩展名的文件怎么打补丁?
  • 问一下diff输出的结果的含义,谢谢。
  • 关于diff和patch的使用
  • 请问linux diff patch怎么用啊?
  • diff程序 dwdiff
  • diff生成的patch 文件中的 "@@ -1,3 +1,4 @@" 是什么意思???
  • diff question
  • diff 比较/dev下的文件出错
  • diff-match-patch
  • 关于diff和patch的使用!!!!很急
  • 如何用diff比较两个文件夹下的内容??
  • [大家帮忙看看吧!!]解压diff.gz文件失败
  • 内核补丁怎么打不上???用的是.diff文件。在线等。。。


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3