User Tools

Site Tools


sed:change:change_string_on_a_range_of_lines

Differences

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

Link to this comparison view

Next revision
Previous revision
sed:change:change_string_on_a_range_of_lines [2020/08/17 23:25] – created 192.168.1.1sed:change:change_string_on_a_range_of_lines [2020/08/17 23:27] (current) 192.168.1.1
Line 4: Line 4:
 sed '1,3 s/unix/linux/' filename sed '1,3 s/unix/linux/' filename
 </code> </code>
 +
 +or
 +
 +<code bash>
 +sed '2,$ s/unix/linux/' filename
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  **$** indicates the last line in the file.
 +
 +So the sed command replaces the text from second line to last line in the file.
 +</WRAP>
 + 
sed/change/change_string_on_a_range_of_lines.1597706747.txt.gz · Last modified: 2020/08/17 23:25 by 192.168.1.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki