udiff – Diffing files/directories
Purpose
udiff is a script that can be used to show the differences between
files or directories. It is an URL-enabled version of the diff
system command. Via ll.url
and ll.orasql
udiff supports
ssh
and oracle
URLs.
Options
udiff supports the following options:
- --error <errorhandlingname>
Encoding error handling to use for reading text files (e.g.
strict
,replace
,ignore
,xmlcharrefreplace
orbackslashreplace
; defaultreplace
).
- -c <mode>, --color <mode>
Should the output of udiff be colored? The default
auto
uses coloring ifstdout
supports it. Valid modes areyes
,no
orauto
.
- -v <flag>, --verbose <flag>
Prints which files are compared before the comparison. When false udiff will be silent as long as no differences are detected. (Valid flag values are
false
,no
,0
,true
,yes
or1
)
- -r <flag>, --recursive <flag>
Compare directories recursively. (Valid flag values are
false
,no
,0
,true
,yes
or1
)
- -i <pattern(s)>, --include <pattern(s)>
Only compares files whose name matches one of the specified patterns.
- -e <pattern(s)>, --exclude <pattern(s)>
Don’t compares files whose name matches one of the specified patterns.
- -b <mode>, --blank <mode>
How to compare whitespace within lines.
literal
compares whitespace literally.trail
ignores differences in trailing whitespace,lead
ignores differences in leading whitespace,both
ignores both leading and trailing whitespace andcollapse
collapses whitespace into a single space before comparing lines.
Examples
Compare two files:
$ udiff foo.txt bar.txt
Recursively compare two directories, but skip the .git
directory:
$ udiff foo/ bar/ -r --skipdir=.git
Recursively compare two Oracle schemas:
$ udiff oracle://user1:pwd@database1 oracle://user2:pwd@database2 -r