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,xmlcharrefreplaceorbackslashreplace; defaultreplace).
- -c <mode>, --color <mode>
Should the output of udiff be colored? The default
autouses coloring ifstdoutsupports it. Valid modes areyes,noorauto.
- -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,yesor1)
- -r <flag>, --recursive <flag>
Compare directories recursively. (Valid flag values are
false,no,0,true,yesor1)
- -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.
literalcompares whitespace literally.trailignores differences in trailing whitespace,leadignores differences in leading whitespace,bothignores both leading and trailing whitespace andcollapsecollapses 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