sed: Remove lines that match a pattern


sed  '/mypattern/d' file


Deletes all files that contain the regular expression “mypattern”.

In-place replacement:

sed --in-place '/mypattern/d' file1


sed also supports making backups with e.g. –in-place=.backup .

  1. No comments yet.
(will not be published)

  1. No trackbacks yet.