偏差値40からのLinux

へんさちよんじゅうからのりなっくす

2007-06-09から1日間の記事一覧

sort

テキストファイルとかをソートする。 オプション -r は結果を反転する$ sort hoge.txt apple orange pine$ sort -r hoge.txt pine orange apple

viで保存→終了する場合

[ZZ](大文字のZをふたつ)で保存して終了してくれる。 [:wq]に相当。

expand

tabをスペースに変換 expand [オプション] [ファイル] TABを含むテキストファイルをTAB幅を4文字に指定して標準出力へ出力。 $ cat tabtab.txt 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 $ expand -t4 tabtab.txt 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 逆(空白からTAB)のunex…

od

8進数等で表示 $ od [オプション] [ファイル名] hoge.txtを16進数で表示。 $ od -tx hoge.txt 0000000 6c707061 726f0a65 65676e61 6e69700a 0000020 000a0a65 0000023 hoge.txtを8進数で表示。 $ od -to hoge.txt 0000000 15434070141 16233605145 1453…

grep

使用法: grep [オプション] 文字列パターン [ファイル] $ cat ./hoge.txt apple orange pine$ grep ra ./hoge.txt orange