man of diff

DIFF

Section: GNU Tools (1)
Updated: 22sep1993


 

名字

diff - 找出两个文件的不同点  

总览

diff [选项] 源文件 目标文件  

描述

在最简单的情况是, diff 比较两个文件的内容 (源文件目标文件). 文件名可以是 - 由标准输入设备读入的文本. 作为特别的情况是, diff - - 比较一份标准输入的它自己的拷贝如果 源文件 是一个目录和 目标文件 不是(目录), diff 会比较在 源文件(目录) 里的文件的中和 目标文件同名的(文件), 反过来也一样. 非目录文件不能是 -. 如果 源文件目标文件 都是目录, diff 比较两个目录中相应的文件,依照字母次序排序;这个比较是不会递归的,除非给出 -r 或者 --recursive. diff 不把一个目录的内容看为它是一个文件来比较。被指定的文件不能是标准的输入, 因为标准的输入是无名的并且"有一样的名字的文件"的观点不适用。 diff 的选项由 -, 开始所以正常地 源文件(名)目标文件(名) 不可以用 - 开头. 然而, -- 可以被它视为保留的即使作为文件名的开头( they begin with -.  

选项

下面是 GNU所接受的 diff 的所有选项的概要. 大多数的选项有两个相同的名字,一个是单个的跟在 - 后面字母, 另一个是由 -- 引出的长名字. 多个单字母选项(除非它们产生歧义)能够组合为单行的命令行语法 -ac 是等同于 -a -c. 长命名的选项能被缩短到他们的名字的任何唯一的前缀. 用 ([]) 括起来显示选项产生歧义的选项

- 行数(一个整数)
显示上下文 行数 (一个整数). 这个选项自身没有指定输出格式,这是没有效果的,除非和 -c 或者 -u 组合使用. 这是已废置的选项,对于正确的操作, 上下文至少要有两行。
-a
所有的文件都视为文本文件来逐行比较,甚至他们似乎不是文本文件.
-b
忽略空格引起的变化.
-B
忽略插入删除空行引起的变化.
--brief
仅报告文件是否相异,在乎差别的细节.
-c
使用上下文输出格式.
-C 行数(一个整数)

--context[= lines ]
使用上下文输出格式,显示以指定 行数 (一个整数), 或者是三行(当 行数 没有给出时. 对于正确的操作, 上下文至少要有两行.
--changed-group-format= format
使用 format 输出一组包含两个文件的不同处的行,其格式是 if-then-else .
-d
改变算法也许发现变化的一个更小的集合.这会使 diff 变慢 (有时更慢).
-D name
合并 if-then-else 格式输出, 预处理宏(由name参数提供)条件.
-e

--ed
输出为一个有效的 ed 脚本.
--exclude= pattern
比较目录的时候,忽略和目录中与 pattern(样式) 相配的.
--exclude-from= file
比较目录的时候,忽略和目录中与任何包含在 file(文件) 的样式相配的文件和目录.
--expand-tabs
在输出时扩展tab为空格,保护输入文件的tab对齐方式
-f
产生一个很象 ed 脚本的输出,但是但是在他们在文件出现的顺序有改变
-F regexp
在上下文和统一格式中,对于每一大块的不同,显示出匹配 regexp. 的一些前面的行.
--forward-ed
产生象 ed 脚本的输出,但是它们在文件出现的顺序有改变。
-h
这选项现在已没作用,它呈现Unix的兼容性.
-H
使用启发规则加速操作那些有许多离散的小差异的大文件.
--horizon-lines= lines
比较给定行数的有共同前缀的最后行,和有共同或缀的最前行.
-i
忽略大小写.
-I regexp
忽略由插入,删除行(由regexp 参数提供参考)带来的改变.
--ifdef= name
合并 if-then-else 格式输出, 预处理宏(由name参数提供)条件.
--ignore-all-space
在比较行的时候忽略空白.
--ignore-blank-lines
忽略插入和删除空行
--ignore-case
忽略大小写.
--ignore-matching-lines= regexp
忽略插入删除行(由regexp 参数提供参考).
--ignore-space-change
忽略空白的数量.
--initial-tab
在文本行(无论是常规的或者格式化的前后文关系)前输出tab代替空格. 引起的原因是tab对齐方式看上去象是常规的一样.
-l
产生通过 pr 编码的输出.
-L label

--label= label
使用 label 给出的字符在文件头代替文件名输出.
--left-column
以并列方式印出两公共行的左边
--line-format= format
使用 format 输出所有的行,在 if-then-else 格式中.
--minimal
改变算法也许发现变化的一个更小的集合.这会使 diff 变慢 (有时更慢).
-n
输出 RC-格式 diffs; 除了每条指令指定的行数受影响外 象 -f 一样。
-N

--new-file
在目录比较中,如果那个文件只在其中的一个目录中找到,那么它被视为在另一个目录中是一个空文件.
--new-group-format= format
使用 format 以if-then-else 格式输出只在第二个文件中取出的一个行组
--new-line-format= format
使用 format 以if-then-else 格式输出只在第二个文件中取出的一行
--old-group-format= format
使用 format 以if-then-else 格式输出只在第一个文件中取出的一个行组
--old-line-format= format
使用 format 使用 format 以if-then-else 格式输出只在第一个文件中取出的一行
-p
显示带有c函数的改变.
-P
在目录比较中,如果那个文件只在其中的一个目录中找到,那么它被视为在另一个目录中是一个空文件.
--paginate
产生通过 pr 编码的输出.
-q
仅报告文件是否相异,不报告详细的差异.
-r
当比较目录时,递归比较任何找到的子目录.
--rcs
输出 RC-格式 diffs; 除了每条指令指定的行数受影响外 象 -f 一样。
--recursive
当比较目录时,递归比较任何找到的子目录.
--report-identical-files

-s
报告两个文件相同.
-S file
当比较目录时,由 file 开始. 这用于继续中断了的比较.
--sdiff-merge-assist
打印附加的信息去帮助 sdiff. sdiff 在运行 diff 时使用这些选项. 这些选项不是特意为使用者直接使用而准备的。
--show-c-function
显示带有c函数的改变.
--show-function-line= regexp
在上下文和统一的格式,对于每一大块的差别,显示出匹配 regexp. 的一些前面的行
--side-by-side
使用并列的输出格式.
--speed-large-files
使用启发规则加速操作那些有许多离散的小差异的大文件.
--starting-file= file
当比较目录时,由 file 开始. 这用于继续中断了的比较.
--suppress-common-lines
在并列格式中不印出公共行。
-t
在输出时扩展tab为空格,保护输入文件的tab对齐方式
-T
在文本行(无论是常规的或者格式化的前后文关系)前输出tab代替空格.引起的原因是tab对齐方式看上去象是常规的一样.
--text
所有的文件都视为文本文件来逐行比较,甚至他们似乎不是文本文件.
-u
使用统一的输出格式.
--unchanged-group-format= format
使用 format 输出两个文件的公共行组,其格式是if-then-else.
--unchanged-line-format= format
使用 format 输出两个文件的公共行,其格式是if-then-else.
--unidirectional-new-file
在目录比较中,如果那个文件只在其中的一个目录中找到,那么它被视为在另一个目录中是一个空文件.
-U lines

--unified[= lines ]
使用前后关系格式输出,显示以指定 行数 (一个整数), 或者是三行(当 行数 没有给出时. 对于正确的操作, 上下文至少要有两行.
-v

--version
输出 diff 版本号.
-w
在比较行时忽略空格
-W columns

--width= columns
在并列格式输出时,使用指定的列宽.
-x pattern
比较目录的时候,忽略和目录中与 pattern(样式) 相配的.
-X file
比较目录的时候,忽略和目录中与任何包含在 file(文件) 的样式相配的文件和目录.
-y
使用并列格式输出

 

参考

cmp(1), comm(1), diff3(1), ed(1), patch(1), pr(1), sdiff(1).  

DIAGNOSTICS

退出状态为0意味着没有差别, 1意味着有一些不同。 2意味很有问题(许多差异)

KCONFIG-CONF(1) October 2017 KCONFIG-CONF(1) NAME kconfig-conf - Standalone implementation of the Linux Kconfig parser SYNOPSIS kconfig-conf [options] <KConfig_file> DESCRIPTION The kconfig toolkit support the Kconfig language and implement the parser and the configuration support associated to the KConfig files respecting the Linux kernel KConfig convention. At configuration time: • kconfig-mconf is based on ncurses (menuconfig) • kconfig-conf is based on dialog (config) • kconfig-gconf is based on GTK+ (gconfig) • kconfig-qconf is based on QT (qconfig) Associated tools: • kconfig-diff displays symbols diff between .config files OPTIONS --silentoldconfig Only for kconfig-conf, reload a given .config and regenerate header and command files accordingly. --allnoconfig Set all boolean configuration to no. --allyesconfig Set all boolean configuration to yes. --randconfig Generates a random configuration. ENVIRONMENT Environment variables for '*config' KCONFIG_CONFIG This environment variable can be used to specify a default kernel config file name to override the default name of ".config". KCONFIG_OVERWRITECONFIG If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not break symlinks when .config is a symlink to somewhere else. CONFIG_ If you set CONFIG_ in the environment, Kconfig will prefix all symbols with its value when saving the configuration, instead of using the default, "CONFIG_". Environment variables for '{allyes/allmod/allno/rand}config' KCONFIG_ALLCONFIG The allyesconfig/allmodconfig/allnoconfig/randconfig variants can also use the environment variable KCONFIG_ALLCONFIG as a flag or a filename that contains config symbols that the user requires to be set to a specific value. If KCONFIG_ALLCONFIG is used without a filename where KCONFIG_ALLCONFIG == "" or KCONFIG_ALLCONFIG == "1", "make *config" checks for a file named "all{yes/mod/no/def/random}.config" (corresponding to the *config command that was used) for symbol values that are to be forced. If this file is not found, it checks for a file named "all.config" to contain forced values. This enables you to create "miniature" config (miniconfig) or custom config files containing just the config symbols that you are interested in. Then the kernel config system generates the full .config file, including symbols of your miniconfig file. This 'KCONFIG_ALLCONFIG' file is a config file which contains (usually a subset of all) preset config symbols. These variable settings are still subject to normal dependency checks. Examples: KCONFIG_ALLCONFIG=custom-notebook.config make allnoconfig or KCONFIG_ALLCONFIG=mini.config make allnoconfig or make KCONFIG_ALLCONFIG=mini.config allnoconfig These examples will disable most options (allnoconfig) but enable or disable the options that are explicitly listed in the specified mini-config files. Environment variables for 'randconfig' KCONFIG_SEED You can set this to the integer value used to seed the RNG, if you want to somehow debug the behaviour of the kconfig parser/frontends. If not set, the current time will be used. KCONFIG_PROBABILITY This variable can be used to skew the probabilities. See /usr/share/doc/kconfig-frontends/kconfig.txt.gz. Environment variables for 'silentoldconfig' KCONFIG_NOSILENTUPDATE If this variable has a non-blank value, it prevents silent kernel config updates (requires explicit updates). KCONFIG_AUTOCONFIG This environment variable can be set to specify the path name of the "auto.conf" file. Its default value is "include/config/auto.conf". KCONFIG_TRISTATE This environment variable can be set to specify the path name of the "tristate.conf" file. Its default value is "include/config/tristate.conf". KCONFIG_AUTOHEADER This environment variable can be set to specify the path name of the "autoconf.h" (header) file. Its default value is "include/generated/autoconf.h". HISTORY June 2017, Man page originally compiled by Philippe Thierry (phil at reseau-libre dot com) Philippe Thierry kconfig-conf Man Page KCONFIG-CONF(1)
08-08
KCONFIG-CONF(1) October 2017 KCONFIG-CONF(1) NAME kconfig-conf - Standalone implementation of the Linux Kconfig parser SYNOPSIS kconfig-conf [options] <KConfig_file> DESCRIPTION The kconfig toolkit support the Kconfig language and implement the parser and the configuration support associated to the KConfig files respecting the Linux kernel KConfig convention. At configuration time: • kconfig-mconf is based on ncurses (menuconfig) • kconfig-conf is based on dialog (config) • kconfig-gconf is based on GTK+ (gconfig) • kconfig-qconf is based on QT (qconfig) Associated tools: • kconfig-diff displays symbols diff between .config files OPTIONS –silentoldconfig Only for kconfig-conf, reload a given .config and regenerate header and command files accordingly. --allnoconfig Set all boolean configuration to no. --allyesconfig Set all boolean configuration to yes. --randconfig Generates a random configuration. ENVIRONMENT Environment variables for ‘*config’ KCONFIG_CONFIG This environment variable can be used to specify a default kernel config file name to override the default name of ".config". KCONFIG_OVERWRITECONFIG If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not break symlinks when .config is a symlink to somewhere else. CONFIG_ If you set CONFIG_ in the environment, Kconfig will prefix all symbols with its value when saving the configuration, instead of using the default, "CONFIG_". Environment variables for ‘{allyes/allmod/allno/rand}config’ KCONFIG_ALLCONFIG The allyesconfig/allmodconfig/allnoconfig/randconfig variants can also use the environment variable KCONFIG_ALLCONFIG as a flag or a filename that contains config symbols that the user requires to be set to a specific value. If KCONFIG_ALLCONFIG is used without a filename where KCONFIG_ALLCONFIG == "" or KCONFIG_ALLCONFIG == "1", "make *config" checks for a file named "all{yes/mod/no/def/random}.config" (corresponding to the *config command that was used) for symbol values that are to be forced. If this file is not found, it checks for a file named "all.config" to contain forced values. This enables you to create "miniature" config (miniconfig) or custom config files containing just the config symbols that you are interested in. Then the kernel config system generates the full .config file, including symbols of your miniconfig file. This 'KCONFIG_ALLCONFIG' file is a config file which contains (usually a subset of all) preset config symbols. These variable settings are still subject to normal dependency checks. Examples: KCONFIG_ALLCONFIG=custom-notebook.config make allnoconfig or KCONFIG_ALLCONFIG=mini.config make allnoconfig or make KCONFIG_ALLCONFIG=mini.config allnoconfig These examples will disable most options (allnoconfig) but enable or disable the options that are explicitly listed in the specified mini-config files. Environment variables for ‘randconfig’ KCONFIG_SEED You can set this to the integer value used to seed the RNG, if you want to somehow debug the behaviour of the kconfig parser/frontends. If not set, the current time will be used. KCONFIG_PROBABILITY This variable can be used to skew the probabilities. See /usr/share/doc/kconfig-frontends/kconfig.txt.gz. Environment variables for 'silentoldconfig' KCONFIG_NOSILENTUPDATE If this variable has a non-blank value, it prevents silent kernel config updates (requires explicit updates). KCONFIG_AUTOCONFIG This environment variable can be set to specify the path name of the "auto.conf" file. Its default value is "include/config/auto.conf". KCONFIG_TRISTATE This environment variable can be set to specify the path name of the "tristate.conf" file. Its default value is "include/config/tristate.conf". KCONFIG_AUTOHEADER This environment variable can be set to specify the path name of the "autoconf.h" (header) file. Its default value is "include/generated/autoconf.h". HISTORY June 2017, Man page originally compiled by Philippe Thierry (phil at reseau-libre dot com) Philippe Thierry kconfig-conf Man Page KCONFIG-CONF(1) 这是手册
最新发布
08-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值