Linux命令之---diff
2024-10-21 03:57:57
命令介绍
diff命令可以酌行比较纯文本文件内的内容,并输出文件的差异。
命令格式
diff [option] [file1] [file2]
举例子
1)比较俩文本文件
[root@king ~]# cat test1 [root@king ~]# cat test2 [root@king ~]# diff test1 test2
,3d0 #<==删除文件1的第1行到第3行,删除文件2的第0行,即不删除。
<
<
<
6a4, #<==文件1的第6行增加下面2行文本,即文本2的第4行和第5行
>
>
2)并排格式输出
[root@king ~]# diff -y test1 test2 #<==使用-y参数就可以并排输出。
<
<
< >
>
[root@king ~]# diff -y -W test1 test2 #<==如果觉得上面太宽,则可以使用-W参数
指定宽度。
<
<
< >
>
最新文章
- 为什么基于TCP UDP服务的一些简单服务端口号都是奇数
- Flat UI 工具包
- [问题2014A06] 解答
- html 圆角边框
- Sqli-labs less 26
- javascript实现经纬度与地址的互转
- 再回首,Java温故知新(十一):Java反射
- Android 安装过程中的问题
- OSG多屏显示问题
- iOS安全攻防之结构体保护使用
- EBS 系统标准职责定义MAP
- 利用python抓取页面数据
- python将文本写入剪切板
- linux 安装 redsi
- Can We Make Operating Systems Reliable and Secure?
- 使用 HTTP/2 提升性能的几个建议
- WdatePicker控件中日期的范围选择
- (A - 整数划分 HYSBZ - 1263)(数组模拟大数乘法)
- uafxcwd.lib(afxmem.obj) : error LNK2005: ";void * __cdecl operator new(unsigned int)";解决办法
- java程序后台报错java.net.SocketException: Too many open files
热门文章
- java实现定时任务(Quartz)
- WCF 内置绑定在不同的传输安全模式下的信道层
- 并发包阻塞队列之ArrayBlockingQueue
- nodejs入门学习笔记二——解决阻塞问题
- Catch the moments of your life. Catch them while you&#39;re young and quick.
- [转]ubuntu16.04安装teamviewer12依赖包解决
- logback的加载过程
- 获得session中的用户信息
- mybatis-关联关系2
- Mybatis- 配置