今日からあなたもLinuxシステム管理者cut各行から必要な部分文字列を取り出す。例えば、grepの結果等で行の一部分だけ表示させて一覧性を良くしたい場合がある。cutコマンドにパイプでつなぐと各行の任意の部分を取り出すことができる。[mobile@localhost mobile]$ grep allergy test | cut -c -70-c -70とあるのは70バイト目まで表示させる意味である。あるいは10~30バイト [mobile@localhost mobile]$ grep allergy test | cut -c 10-30といった指定や5バイト以降 [mobile@localhost mobile]$ grep allergy test | cut -c 5-といった指定も可能である。
Copyright(C) 2004-2015 モバイル開発系(K) All rights reserved.
[Home]
|