//View Tip #45
Similar Tips
» Find and replace with backup
» SSH Auto Complete
» Find occurrences of a string in a large code base without firing
» Manipulate Bash sockets using /dev/tcp
» Directories and its size


Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
multiple command output into a single program:

diff -u <(ls -c1 dir_1) <(ls -c1 dir_2)

Will show you a diff of files in the root of dir_1 and dir_2

View Comments »


Add your comment

Comments are currently disabled
Thanks, this was very useful. I've been looking for a way of taking stdin for generating diffs (e.g. copying & pasting from different sources) in vimdiff (though this should be applicable elsewhere too). I found putting a dummy command (i.e. one with no output) in the parenthesis to be the best solution...

$ vimdiff <(echo) <(cat /dev/null)

Proceed to paste whatever you want to compare into the two panes..
Posted 2009-03-10 12:35:30
George Avasar
in ls -c1, what is the purpose of the one "1"?
If you want it ordered by ctime, why not just -c?
Posted 2010-09-19 11:40:40

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit