linux diff(differential) 命令
功能说明:比较文件的差异。
语法:diff [OPTION]... FILES
实例:
diff -ur temp1 temp2
diff -ur temp1 temp2 > temp.diff
option详细:
--normal | output a normal diff (This is the default). |
-q, --brief | report only when files differ. |
-s, --report-identical-files | report when two files are the same. |
-c, -C NUM, --context[=NUM] | output NUM (default 3) lines of copied context. |
-u, -U NUM, --unified[=NUM] | output NUM (default 3) lines of unified context. |
-e, --ed | output an ed script. |
-n, --rcs | output an RCS-format diff. |
-y, --side-by-side | output in two columns. |
-W, --width=NUM | output at most NUM (default 130) print columns. |
--left-column | output only the left column of common lines. |
--suppress-common-lines | do not output common lines. |
-p, --show-c-function | show which C function each change is in. |
-F, --show-function-line=RE | show the most recent line matching RE. |
--label LABEL | use LABEL instead of file name (this option can be repeated). |
-t, --expand-tabs | expand tabs to spaces in output. |
-T, --initial-tab | make tabs line up by prepending a tab. |
--tabsize=NUM | tab stops every NUM (default 8) print columns. |
--suppress-blank-empty | suppress space or tab before empty output lines. |
-l, --paginate | pass output through pr to paginate it |
-r, --recursive | recursively compare any subdirectories found. |
-N, --new-file | treat absent files as empty. |
--unidirectional-new-file | treat absent first files as empty. |
--ignore-file-name-case | ignore case when comparing file names. |
--no-ignore-file-name-case | consider case when comparing file names. |
-x, --exclude=PAT | exclude files that match PAT. |
-X, --exclude-from=FILE | exclude files that match any pattern in FILE. |
-S, --starting-file=FILE | start with FILE when comparing directories. |
--from-file=FILE1 | compare FILE1 to all operands; FILE1 can be a directory. |
--to-file=FILE2 | compare all operands to FILE2; FILE2 can be a directory. |
-i, --ignore-case | ignore case differences in file contents. |
-E, --ignore-tab-expansion | ignore changes due to tab expansion. |
-b, --ignore-space-change | ignore changes in the amount of white space. |
-w, --ignore-all-space | ignore all white space. |
-B, --ignore-blank-lines | ignore changes whose lines are all blank. |
-I, --ignore-matching-lines=RE | ignore changes whose lines all match RE. |
-a, --text | treat all files as text. |
--strip-trailing-cr | strip trailing carriage return on input. |
-D, --ifdef=NAME | output merged file with `#ifdef NAME' diffs. |
--GTYPE-group-format=GFMT | format GTYPE input groups with GFMT. |
--line-format=LFMT | format all input lines with LFMT. |
--LTYPE-line-format=LFMT | format LTYPE input lines with LFMT.
These format options provide fine-grained control over the output of diff, generalizing -D/--ifdef. LTYPE is 'old', 'new', or 'unchanged'. GTYPE is LTYPE or `changed'. GFMT (only) may contain: %<: lines from FILE1 %>: lines from FILE2 %=: lines common to FILE1 and FILE2. %[-][WIDTH][.[PREC]]{doxX}LETTER: printf-style spec for LETTER LETTERs are as follows for new group, lower case for old group: F: first line number L: last line number N: number of lines = L-F+1 E: F-1 M: L+1 %(A=B?T:E) if A equals B then T else E LFMT (only) may contain: %L: contents of line %l: contents of line, excluding any trailing newline %[-][WIDTH][.[PREC]]{doxX}n: printf-style spec for input line number Both GFMT and LFMT may contain: %%: A literal '%' %c'C': the single character C %c'\OOO': the character with octal code OOOC: the character C (other characters represent themselves) |
-d, --minimal | try hard to find a smaller set of changes. |
--horizon-lines=NUM | keep NUM lines of the common prefix and suffix. |
--speed-large-files | assume large files and many scattered small changes. |
--help | display a help message and exit. |
-v, --version | output version information and exit. |
linux diff(differential) 命令的更多相关文章
- linux diff命令
diff 命令是 linux上非常重要的工具,用于比较文件的内容,特别是比较两个版本不同的文件以找到改动的地方.diff在命令行中打印每一个行的改动.最新版本的diff还支持二进制文件.diff程序的 ...
- linux diff 命令
diff 命令是 linux上非常重要的工具,用于比较文件的内容,特别是比较两个版本不同的文件以找到改动的地方.diff在命令行中打印每一个行的改动.最新版本的diff还支持二进制文件.diff程序的 ...
- linux下svn命令使用大全
最近经常使用svn进行代码管理,这些命令老是记不住,得经常上网查,终于找了一个linux下svn命令使用大全:1.将文件checkout到本地目录 svn checkout path(path是服务器 ...
- DAY1 linux 50条命令
1. tar压缩,解压缩 tar -cvf *** (压缩) tar -xvf *** (解压缩) [root@bogon ~]# tar cvf test.tar test/ test/ test ...
- linux下tar命令详解
linux下tar命令详解 tar是Linux环境下最常用的备份工具之一.tar(tap archive)原意为操作磁带文件,但基于Linux的文件操作机制,同样也可适用于普通的磁盘文件.ta ...
- Linux下svn命令详解
本文主要是说明linux下svn命令的使用方法,同时记录自己在使用中遇到的一些疑惑. 1.Linux命令行下将文件checkout到本地目录 svn checkout url(url是服务器上的目录) ...
- linux下svn命令大全
linux下svn命令大全 1.将文件checkout到本地目录 svn checkout path(path是服务器上的目录) 例如:svn checkout svn://192.168.1.1/p ...
- Linux常用脚本命令总结
基本操作 通用操作 1. export 显示所有的环境变量,也可以获取到某个变量的详细信息: export # 显示所有 echo $SHELL # 只显示SHELL 2. whereis 使用系统自 ...
- Linux系统常用命令权威指南
<一>线上查询及帮助命令(2)1.man man [选项] [命令] 查看命令帮助,命令的词典,更复杂的还有info,但不常用. #man cd-a 显示所有的手册页,不只是显示第一个-f ...
随机推荐
- WebCalendar.js
var cal; var isFocus=false; //是否为焦点 var pickMode ={ "second":1, "minu ...
- Ubuntu 安装 Memcached
直接使用命令 sudo apt-get install Memcached 进行安装 安装完, 默认只能本地连接,需要修改一下配制文件,打开 /etc/Memcached.conf 文件, 找到一个 ...
- centos7 守护进程
ASP.NET Core应用程序发布linux在shell中运行是正常的.可一但shell关闭网站也就关闭了,所以要配置守护进程, 用的是Supervisor,本文主要记录配置的过程和过程遇到的问题 ...
- 解决$ git clone fatal: Authentication failed
今天在使用git clone克隆项目的时候报如下错误: $ git clone XXXXXX Cloning into 'XXXX'... fatal: Authentication failed f ...
- offsetWidth和width的区别
1.offsetWidth属性可以返回对象的padding+border+width属性值之和,style.width返回值就是定义的width属性值. 2.offsetWidth属性仅是可读属性,而 ...
- ubuntu安装ICE记录
背景本文档介绍在unbuntu环境下如何安装ICE,并用C++写一个ICE应用 ICE简介ICE是ZEROC的开源通信协议产品,它的全称是:The Internet Communications En ...
- jquery之链式调用,层级菜单
一. 链式调用的含义 jquery对象的方法会在执行完后返回这个jquery对象,所有jquery对象的方法可以连起来写: $('#div1') // id为div1的元素 .children('ul ...
- Linux一些常用的基础命令,总结的很好,收藏了
原文地址:https://www.cnblogs.com/yjd_hycf_space/p/7730690.html
- openstack 的horizon的结构
openstack的控制台应用horizon 特点: 1.界面的显示元素进行深度封装: 将元素的后台与前台模板结合在一起.制作html整个界面有点类似搭积木组合的方式. 2.模块加载: 根据权限对ur ...
- SQLAlachemy 自动提交配置 SQLALCHEMY_COMMIT_ON_TEARDOWN
挖坑:自动提交省去了每次 commit,添加数据对象后立马取 id 返回None 填坑 :立马要取 id 的地方 commit一下