commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Use ^D instead of exit.
Also ^D ends input stream when you use terminal for typing into standard input.
Or just do history -w before opening another terminal.
cat file1 file2 file3|sort|uniq -d
finds the same lines in several files, especially in files with lists of files.