4
3

More than 5 years have passed since last update.

grepで長い行を省略しながら表示

Posted at

先頭から50文字と、末尾から50文字を、「...」で省略しながら表示。

grep 'pattern' filename | awk '{print substr($0, 1, 50) "..." substr($0, length($0) - 50, length($0))}'
4
3
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
4
3