

What are some time-saving tips that every Linux user should know? - yarapavan
http://www.quora.com/Linux/What-are-some-time-saving-tips-that-every-Linux-user-should-know?srid=3SO

======
yarapavan
Never knew that one can do set operations using sort and uniq.

For example, a and b are text files that are already unique. Note this is
fast, and works on files of arbitrary size, up to many gigabytes. (Sort is not
limited by memory, though you may need to use -T if you have a small root
partition.)

cat a b | sort | uniq > c # c is a union b

cat a b | sort | uniq -d > c # c is a intersection b

cat a b b | sort | uniq -u > c # c is set difference a - b

