|
发表于 2005-11-2 19:58:09
|
显示全部楼层
呵呵。
有这么便宜的事?
uniq -c ==
uniq --help:
Usage: uniq [OPTION]... [INPUT [OUTPUT]]
Discard all but one of successive identical lines from INPUT (or
standard input), writing to OUTPUT (or standard output).
长选项必须用的参数在使用短选项时也是必须的。
-c, --count prefix lines by the number of occurrences
-d, --repeated only print duplicate lines
-D, --all-repeated[=delimit-method] print all duplicate lines
delimit-method={none(default),prepend,separate}
Delimiting is done with blank lines.
-f, --skip-fields=N avoid comparing the first N fields
-i, --ignore-case ignore differences in case when comparing
-s, --skip-chars=N avoid comparing the first N characters
-t, --separator=SEP use SEParator to delimit fields
-u, --unique only print unique lines
-w, --check-chars=N compare no more than N characters in lines
-W, --check-fields=N compare no more than N fields in lines
--help 显示此帮助信息并离开
--version 显示版本信息并离开
A field is a run of whitespace, then non-whitespace characters, unless
a SEParator is given. Fields are skipped before chars.
Report bugs to <bug-coreutils@gnu.org>. |
|