Here’s home hints on using sed.

In place replacements

In GNU sed: use -i without arg.

sed -i -e 's/foo/bar/' example.md

In OSX, -i '' is required.

sed -i '' -e 's/foo/bar/' example.md

File regions

sed '/begin api/q'
sed '/^# begin/,$d'
sed -n '/end api/,$p'
0 Comments for this cheatsheet. Write yours!