Diff Two Command Outputs

From Leo's Notes
Revision as of 16:03, 23 April 2013 by Leo (talk | contribs) (Created page with "To run <code>diff</code> on two command outputs, such as two <code>ls</code>'s, run: diff <(cd directory1; ls) <(cd directory2; ls) This is assuming you are using bash, or ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page was last edited on 23 April 2013, at 16:03.

To run diff on two command outputs, such as two ls's, run:

diff <(cd directory1; ls) <(cd directory2; ls)

This is assuming you are using bash, or a shell that can handle sub shells and pipes similar to bash.