Diff: Difference between revisions

No edit summary
adds quick side-by-side example
Line 14: Line 14:
diff -rq -x .svn ./work/myproject/ ./work/myproject-copy2/
diff -rq -x .svn ./work/myproject/ ./work/myproject-copy2/
</source>
</source>
=== Piping ===


The <code>diff</code> command is fast, but often the output is hard to read to find the exact difference.  You might try piping the output of the diff command to a graphical tool:
The <code>diff</code> command is fast, but often the output is hard to read to find the exact difference.  You might try piping the output of the diff command to a graphical tool:
Line 20: Line 22:
</source>
</source>
By using the dash option to kdiff3, you're telling it to read from STDIN, so it uses the output of the former commands being piped to it.
By using the dash option to kdiff3, you're telling it to read from STDIN, so it uses the output of the former commands being piped to it.
Or, piping to <code>awk</code> to print a list of just what's in the 'left side'.
<source lang="bash">
diff --suppress-common-lines --side-by-side modules.list.a.txt modules.list.b.txt |awk '{print $1}'
</source>


=== Compressed files ===
=== Compressed files ===