Print lines between two patterns
print lines between two patterns sed | extract block of text from file | extract certificate from pem file | sed | pattern | excerptsed -n '/BEGIN CERTIFICATE/,/END CERTIFICATE/p' fullchain.pemPrints every line from a match of the start pattern up to and including the next match of the end pattern. If the block occurs several times, all occurrences are printed. In the example, this yields the pure certificate blocks without keys or comments.
Note: The patterns are regular expressions. If they contain a slash, such as </VirtualHost>, it must be written as \/.
Also searched as
- print lines between two patterns sed
- extract block of text from file
- extract certificate from pem file