LoginSignup
1
1

More than 5 years have passed since last update.

linux標準教科書より touch tail sort uniq tr diff

Last updated at Posted at 2016-01-04

touch

更新情報を更新できる
空ファイルを作成したい時にも使える

touch [オプション] ファイル

オプションでは日時を指定して表示できる

head tail

ファイルの表示

head

ファイルの先頭から表示

head [オプション] ファイル
オプション 概要
-n 先頭からn行表示
-c 先頭からcバイト表示

tail

ファイルのけつから表示
更新されるログファイルをけつから追うなどもこれを使ってやったりするよね

tail [オプション] ファイル
オプション 概要
-n けつからn行表示
-c けつからcバイト表示
-f ファイルのけつを表示、ファイルが更新されるたびに表示も変更

sort

ファイルの中身をソートする

sort [オプション] ファイル
オプション 概要
-r 逆順でソート
-k n n列目でソート
-n 数字でソート

uniq

直前の行と同じ行があった場合に対象業を出力しない

uniq ファイル

tr

文字列の置き換え 標準出力のものに使えるお

tr 文字列1 文字列2

diff

ファイルの差分を表示

diff ファイル1 ファイル2

オプションに関してはこちらも参照 http://itdoc.hitachi.co.jp/manuals/3020/30203S3530/JPAS0247.HTM

オプション 概要
-c 削除行に'-'を追加行に'+'をつけて表示
-u 削除行に'-'を追加行に'+'をつけて表示 差異は一つのセクションとして表示
1
1
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
1
1