Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Created February 9, 2017 02:01
Show Gist options
  • Save tkuchiki/42cfba3bd98642060291f4db90aa2040 to your computer and use it in GitHub Desktop.
Save tkuchiki/42cfba3bd98642060291f4db90aa2040 to your computer and use it in GitHub Desktop.
sed の使い方まとめ

マッチした行+以下N行を消す

$ cat /tmp/test.txt
foo
bar
baz
hoge

$ gsed -e '/foo/,+2d' /tmp/test.txt
hoge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment