Sed

Table of Contents

Next: , Up: (dir)   [Contents]

Sed

This manual is for program, version version.


Next: , Previous: , Up: Top   [Contents]

1 learning materials for sed


Previous: , Up: Top   [Contents]

2 often used command for sed

print

sed -n '1,3p' temp.txt  // print line1 to line3

extract log

Extract the lines which include the string from "2012-02-09" to "2012-09-10"
sed -n '/^2012-02-09/,/^2012-09-10/p' whole.log > part.log
reference

add string to line tail

sed 's/$/tail/' test1.txt
reference