Sometimes you might want to diff the output of two commands instead of two files. To do this, simply call

diff <(ls /tmp/folder1) <(ls /tmp/folder2)

See this Linuxjournal article and this blogpost for more details on pipes etc.