Skipping the first n lines when using regex with sed? Skipping the first n lines when using regex with sed? unix unix

Skipping the first n lines when using regex with sed?


Yes, you can apply sed commands to ranges of lines with the N,M syntax. In this case you want something like this:

sed -e '2,$s/foo/bar/'

An example with delete:

sed -e '2,${ /^Name/d }'