LoginSignup
0
0

More than 1 year has passed since last update.

【Linux】uniqコマンドとは?

Posted at

uniqコマンドとは?

ソートされたファイル内の連続した重複行をについてのコマンド。

書式

uniq [オプション] [ファイル名] [出力先]

※オプションを指定しない場合、重複行をまとめて1行だけ表示する。

オプション

オプション 説明
-d 重複している行のみを表示
-u 重複していない行のみを表示

使用例

file1内の重複していない行のみをfile2に出力する場合。

uniq -u file1 file2
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0