faster and one less pipe

pull/63/head
Cody Littlewood 2015-06-17 19:55:12 -04:00
parent f65245236f
commit 2c3197aac4
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ A few examples of piecing together commands:
- It is remarkably helpful sometimes that you can do set intersection, union, and difference of text files via `sort`/`uniq`. Suppose `a` and `b` are text files that are already uniqued. 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 the `-T` option if `/tmp` is on a small root partition.) See also the note about `LC_ALL` above.
```sh
cat a b | sort | uniq > c # c is a union b
cat a b | sort -u > c # c is a union b
cat a b | sort | uniq -d > c # c is a intersect b
cat a b b | sort | uniq -u > c # c is set difference a - b
```