使用法: uniq [オプション]... [入力元 [出力先]]
Filter adjacent matching lines from INPUT (or standard input),
writing to OUTPUT (or standard output).
With no options, matching lines are merged to the first occurrence.
長いオプションに必須の引数は短いオプションにも必須です.
-c, --count 入力中に続けて出現した行の回数を表示
-d, --repeated 重複した行のみを出力
-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
-u, --unique only print unique lines
-z, --zero-terminated end lines with 0 byte, not newline
-w, --check-chars=N 行中, N 文字以上を比較しない
--help この使い方を表示して終了
--version バージョン情報を表示して終了
A field is a run of blanks (usually spaces and/or TABs), then non-blank
characters. Fields are skipped before chars.
Note: 'uniq' does not detect repeated lines unless they are adjacent.
You may want to sort the input first, or use `sort -u' without `uniq'.
Also, comparisons honor the rules specified by `LC_COLLATE'.
Report uniq bugs to bug-coreutils@gnu.org
GNU coreutils home page:
Usage: uniq [OPTION]... [INPUT [OUTPUT]]
Filter adjacent matching lines from INPUT (or standard input),
writing to OUTPUT (or standard output).
With no options, matching lines are merged to the first occurrence.
Mandatory arguments to long options are mandatory for short options too.
-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
-u, --unique only print unique lines
-z, --zero-terminated end lines with 0 byte, not newline
-w, --check-chars=N compare no more than N characters in lines
--help display this help and exit
--version output version information and exit
A field is a run of blanks (usually spaces and/or TABs), then non-blank
characters. Fields are skipped before chars.
Note: 'uniq' does not detect repeated lines unless they are adjacent.
You may want to sort the input first, or use `sort -u' without `uniq'.
Also, comparisons honor the rules specified by `LC_COLLATE'.
Report uniq bugs to bug-coreutils@gnu.org
GNU coreutils home page:
UNIQ(1) UNIQ(1)
名前
uniq - ソートされたファイルから重なった行を削除する
書式
uniq [<+|->N] [-ciduD] [-f N] [-s N] [-w N]
[--all-repeated[={prepend,separate,none}]] [--check-chars=N] [--count]
[--ignore-case] [--repeated] [--skip-chars=N] [--skip-fields=N]
[--unique] [INFILE [OUTFILE]]
uniq [--help] [--version]
説明
uniq は指定された INFILE にあるユニークな (=他と内容の重ならない) 行を
標 準出力 (OUTFILE が指定されていたらそれ) に書き出す。 INFILE が与えら
れなかったり ‘-’ だった場合には、標準入力が用いられる。
デフォルトでは、 uniq はソートされたファイルにあるユニークな行を表示 す
る 。つまり複数の行が同一な内容を持つ場合は、1 行だけ表示して残りは捨て
る。オプションで指定すると、1 回しか現われない行だけを表示したり、複 数
回現われる行だけを表示することもできる。
uniq に与える入力はソートされていなければならない。入力がソートされてい
ない場合は、 ‘sort -u’ を使うのが良いだろう。
-N, -f N, --skip-fields=N
同一行かどうかの判断を行う前に N 個のフィールドをスキップする 。
フィールドとは空白とタブ以外の文字からなる文字列で、フィールド間
は 1 つ以上の空白かタブで区切られる。短いオプション形式 - は推奨
されない。
+N, -s N, --skip-chars=N
同 一行かどうかの判断を行う前に N 個の文字をスキップする。フィー
ルドスキップと文字スキップのオプションを両方指定した場合は、フィ
ー ルドスキップが先に行われる。短いオプション形式 + は推奨されな
い。
-c, --count
それぞれの行が何回現われたかを行の内容とともに表示する。
-i, --ignore-case
比較の際に英大文字小文字の違いを無視する。
-d, --repeated
同じ内容が 2 行以上あるものだけを出力する。
-u, --unique
1 回しか現われない行だけを出力する。
-w N, --check-chars=N
行を比較するとき、各行の N 個の文字だけを使う。これはフィール ド
や文字のスキップを行った後の数である。デフォルトでは、スキップ後
残った文字すべてが比較の対象にされる。
-D, --all-repeated[={prepend,separate,none}]
重複行をすべて表示し、重複しなかった行は表示しない。 prepend が
指定された場合、重複した行のグループの前に改行を出力する。 sepa-
rate は、最初のグループの前に改行を出力しない以外は、 prepend と
同じである。このオプションは、主に他のオプションと組み合わせて使
う。例えば大文字小文字を無視して比較したり、特定のフィールドだけ
で 比較するような場合である。このオプションは GNU による拡張であ
る。
--help 標準出力に使用方法のメッセージを出力して正常終了する。
--version
標準出力にバージョン情報を出力して正常終了する。
注意
プログラムのバグについては bug-textutils@gnu.org に報告してください。
man ページは Ragnar Hojland Espinosa
UNIQ(1) User Commands UNIQ(1)
NAME
uniq - report or omit repeated lines
SYNOPSIS
uniq [OPTION]... [INPUT [OUTPUT]]
DESCRIPTION
Filter adjacent matching lines from INPUT (or standard input), writing
to OUTPUT (or standard output).
With no options, matching lines are merged to the first occurrence.
Mandatory arguments to long options are mandatory for short options
too.
-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
-u, --unique
only print unique lines
-z, --zero-terminated
end lines with 0 byte, not newline
-w, --check-chars=N
compare no more than N characters in lines
--help display this help and exit
--version
output version information and exit
A field is a run of blanks (usually spaces and/or TABs), then non-blank
characters. Fields are skipped before chars.
Note: ’uniq’ does not detect repeated lines unless they are adjacent.
You may want to sort the input first, or use ‘sort -u’ without ‘uniq’.
Also, comparisons honor the rules specified by ‘LC_COLLATE’.
AUTHOR
Written by Richard M. Stallman and David MacKenzie.
REPORTING BUGS
Report uniq bugs to bug-coreutils@gnu.org
GNU coreutils home page:
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa