How to print the content of a file upto the match

To print the content of a file upto the matched string in bash, use the following command.

#sed '/PATTERN/q' filename

Where 'PATTERN' is the string to be searched.

 

Leave a Reply

Your email address will not be published. Required fields are marked *