×

Sign in with twitter.

You can follow the user and hashtags.

Share your tips on social media.

Post relative tips.

If you have relative tips, click [Add relative tips] to post.

grep した時に前後の行も表示したい

@slumbers99@slumbers99 1848 viewer 39 embed viewer embed
-n オプションを使う。
-A n で後n行
-B n で前n行
もできる

cat hoge.txt | grep -3
cat hoge.txt | grep -A 3 -B 3
Add relative tips

Users who share this tip.

Comments