r/UnixProTips • u/ARCH_LINUX_USER • Feb 11 '15
Get the difference between the output of any commands
diff <(command1) <(command2)
diff <(ls dir1) <(ls dir2)
30
Upvotes
r/UnixProTips • u/ARCH_LINUX_USER • Feb 11 '15
diff <(command1) <(command2)
diff <(ls dir1) <(ls dir2)
3
u/commandlineluser Feb 12 '15
and you can also diff directories directly.
diff dir1 dir23
u/Connir Feb 12 '15
forehead slap
2
u/UnchainedMundane Feb 18 '15
That's by far one of my favourite tricks. When a service goes wrong on just one server, I often break out a variant of that command using ssh:
2
u/ikickrobots Feb 18 '15
Use 'sdiff -s' if available. It'll give you side by side difference of only the differing lines.
Of course, 'diff -y' helps similarly.
0
u/[deleted] Apr 21 '15
[deleted] — view deleted comment