Skip to content

Instantly share code, notes, and snippets.

@liusheng
Created January 28, 2019 02:53
Show Gist options
  • Save liusheng/3bb07fe1b1da18d4f60e3a7476387593 to your computer and use it in GitHub Desktop.
Save liusheng/3bb07fe1b1da18d4f60e3a7476387593 to your computer and use it in GitHub Desktop.
sed commands notes
# replace specific word with another word following rows of another specific word
sed -i '/OS::Neutron::Router/,+5s|aaa|bbb|' path/to/file
#similar
sed -i '/OS::Neutron::Router/,+5d' path/to/file
sed '/OS::Neutron::Router/,+5p' path/to/file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment