mardi 2 décembre 2014

How to use Sed to print upto a certain pattern (included)?


I know the following commands will print upto a certain pattern but will not include the patterned line itself:



sed -n '1,/<pattern>/p' <file>

sed '/<pattern>/q' <file>


How to use Sed to print from the start of the file to pattern (included)?



Aucun commentaire:

Enregistrer un commentaire