Sed ' 1,2d '/etc/fstab delete 1, 2 lines, show other rows
Sed '/^\//p '/etc/fstab matches the display, plus the original, there will be 2 duplicate
Sed-n '/^\//p/etc/fstab displays the line that matches the print
Sed '/^\//a \ #hello world '/etc/fstab \ #hello The world tested \# #都可以使用
Sed ' 2r/etc/issue '/etc/fstab after the second line of the/etc/fstab file, add/etc/issue the entire file content
Sed '/oot/w/tmp/oot.txt '/etc/fstab find oot lines in/etc/fstab file, save to/tmp/oot.txt inside
/patten/can use regular expressions
By default, the first string that is matched in each line
\ (\), \1 \2 can also be tried
L.. E:liek-->liker
Love-->lover
&: Reference pattern matches entire string
Sed ' s#1..e#&r#g
G: Global Substitution
I: Ignore case
This article is from the "11498478" blog, please be sure to keep this source http://11508478.blog.51cto.com/11498478/1772804
Linux Scripting Learn A