User Tools

Site Tools


linux:sed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:sed [2020/05/25 08:31] – created bstaffordlinux:sed [2022/11/23 12:49] (current) – external edit 127.0.0.1
Line 3: Line 3:
 To delete line 7 of test.txt To delete line 7 of test.txt
 <code>sed -i 7d test.txt</code> <code>sed -i 7d test.txt</code>
 +===== Delete Line with Text =====
 +<code>sed '/^WHOLELINEOFTEXT$/d' input.txt > output.txt</code>
 =====Append to All Lines===== =====Append to All Lines=====
 To add text to the end of each line in the file test.txt and put the result into test2.txt To add text to the end of each line in the file test.txt and put the result into test2.txt
linux/sed.1590395514.txt.gz · Last modified: (external edit)