Here’s some hints on using sed.
sed -i -e 's/foo/bar/' example.md
In GNU sed: use -i without arg.
sed -i '' -e 's/foo/bar/' example.md
In OSX, -i '' is required.
sed '/begin api/q'
sed '/^# begin/,$d'
sed -n '/end api/,$p'
Print after a given line is found.
sed -n '/regex/d;'
Print everything except lines matching regex. Useful for printing files with comments.
Collection of cheat sheets on the most useful CLI tools: man, tmux, curl, homebrew ...