0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Linux][command] テキスト処理_統計・分割_wc, sort, split

Posted at

wcコマンド

# wc [オプション] [ファイル名]
オプション 由来 説明
default word count - 指定したファイルの行数・単語数・バイト数を表示
-l lines - 行数のみを表示
-w words - 単語数のみを表示
-c bytes - 文字(バイト)数のみを表示

sortコマンド

$ sort [オプション] [ファイル名]
オプション 由来 説明
default sort - 行単位でファイルの内容をソートする
- 昇順でソートする
-b ignore leading blanks - 先頭の空白を無視して比較する
-d dictionary order - 英数字と空白のみを考慮して比較する
-f fold case - 大文字小文字を区別せずに比較する
-g general numeric sort - 数値として比較(指数表記も対応)
-i ignore non-printing - 印刷できない文字を無視
-M month sort - 月名(Jan, Feb, ...)でソート
-n numeric sort - 数値として比較(整数のみ)
-r reverse - 降順(逆順)にソート
-k key - 指定したフィールド(列)でソート
-t field separator - フィールド(列)の区切り文字を指定
-u unique - 重複行を削除
-V version sort - バージョン番号順にソート
-o output file - 結果を指定したファイルに保存
-c check - ソートされているか確認
--help help - 使用方法を表示
--version version - バージョン情報を表示

splitコマンド

# split [オプション] [入力ファイル] [出力ファイルの接頭辞]
オプション 由来 説明
default split(分割) - 入力ファイルを1000行ごとに分割する
- 出力ファイル名は接頭辞'x'に接尾辞'aa', 'ab', 'ac', ...を付けた形式で作成される
-b SIZE bytes - 指定したSIZE(バイト数)ごとにファイルを分割する
- SIZEにはK(キロバイト)、M(メガバイト)などの単位を使用できる
-l NUMBER lines - 指定したNUMBER(行数)ごとにファイルを分割する
- NUMBER lines - 指定したNUMBER(行数)ごとにファイルを分割する

Ping-t

wc

split

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?