How to delete a line containing a pattern using sed.
Contents of test.txt.
$ cat test.txt
one
two
three |
Delete a line matching the string “one.”
sed -i '/one/d' test.txt |
Display test.txt
$ cat test.txt
two
three |
cloud engineer
How to delete a line containing a pattern using sed.
Contents of test.txt.
$ cat test.txt
one
two
three |
$ cat test.txt one two three
Delete a line matching the string “one.”
sed -i '/one/d' test.txt |
sed -i '/one/d' test.txt
Display test.txt
$ cat test.txt
two
three |
$ cat test.txt two three