このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
bash:script:01_extract_some_row_in_file [2014/06/05 06:31] – bash:script:extract_some_row_in_file renamed to bash:script:01_extract_some_row_in_file matsui | bash:script:01_extract_some_row_in_file [2021/08/03 20:12] (現在) – matsui | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== 01 ファイルの指定行を抜き出す====== | ||
+ | ===== 指定行を表示 ===== | ||
+ | |||
+ | これで、hogehoge.confの100行目を表示 | ||
+ | <code console> | ||
+ | $ sed -n 100p / | ||
+ | </ | ||
+ | |||
+ | ===== 指定行間を表示 ===== | ||
+ | |||
+ | |||
+ | これで、hogehoge.confの100行目~120行目を表示 | ||
+ | <code console> | ||
+ | $ sed -n 100,120p / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== 指定行目以降を表示 ===== | ||
+ | |||
+ | これで100行目以降を表示 | ||
+ | < | ||
+ | $ tail -n +100 / | ||
+ | </ | ||
+ | |||
+ | ===== 指定行目以降でawk ===== | ||
+ | |||
+ | 3行目以降を表示 | ||
+ | < | ||
+ | $ awk ' | ||
+ | </ | ||
+ | |||
+ | |||
+ | {{tag> |