在Linux下,有很多个文档比较工具,diff,sdiff, comm, cmp等。整体来说都不是很好用。
相对而言,还是sdiff功能比较强大一些。
Example 1: sdiff -s 1.txt 2. txt
-s:
--suppress-common-lines:
Do not print common lines
-w columns
--width=columns
Use an output width of columns. Note that for historical reasons, this option is -W in diff, -w in sdiff.
Example 1: do not print common line
[root@localhost ~]# sdiff -s 1.bashrc 2.bashrc
# box to box deployment | # 1004 box to box deployment
alias 109='telnet 10.74.9.109' <
#switcher information | # public switcher information
alias 185='ssh asr@10.74.9.185' |
alias 190='ssh asr@10.74.9.190' |
> # linux virtual machine
> alias 185='ssh -X asr@10.74.9.185'
> alias 190='ssh -X asr@10.74.9.190'
> alias 203='ssh asr@10.74.30.203'
> alias 204='ssh asr@10.74.30.204'
> alias 205='ssh asr@10.74.30.205'
[root@localhost ~]#
Example 1: specify colomn
[root@localhost ~]# sdiff -s -w 150 1.bashrc 2.bashrc
# box to box deployment | # 1004 box to box deployment
alias 109='telnet 10.74.9.109' <
#switcher information | # public switcher information
alias 185='ssh asr@10.74.9.185' |
alias 190='ssh asr@10.74.9.190' |
> # linux virtual machine
> alias 185='ssh -X asr@10.74.9.185'
> alias 190='ssh -X asr@10.74.9.190'
> alias 203='ssh asr@10.74.30.203'
> alias 204='ssh asr@10.74.30.204'
> alias 205='ssh asr@10.74.30.205'
[root@localhost ~]#
diff和sdiff使用心得
最新推荐文章于 2024-05-25 12:41:13 发布