Differences

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

Link to this comparison view

sed_examples [2012/12/31 12:51] (current)
Line 1: Line 1:
 +====== sed examples ======
  
 +  * [[sed]]
 +
 +
 +== Remove one line ==
 +
 +<​code>​
 +sed -e '​1d'​
 +</​code>​
 +
 +== Remove a range of lines ==
 +
 +<​code>​
 +sed -e '​2,​4d'​
 +</​code>​
 +
 +== Remove all trailing numbers and spaces behind it ==
 +
 +<​code>​
 +sed -e '​s/​[1-9]* *//'
 +</​code>​
 +
 +== Replace tabs with commas ==
 +
 +<​code>​
 +sed -e '​s/​\t/,/​g'​
 +</​code>​