Here’s a nifty little trick with vimdiff, say you want to compare the output of to commands. You can do so with a little redirections:

# vimdiff <(cat /etc/passwd) <(cat /etc/shadow)

I know this is silly since you can simply vimdiff the files directly without the redirects. But say you want to compare who is currently logged in with who was last 10 people logged in.

# vimdiff <(who) <(last|head)

Boom.

Note: the space between th ‘)’ and the ‘<’ is required.

Leave a Reply