1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| sed '2,5d' sed '2d' sed '3,$d'
sed '/root/d'
sed '2a insert str' sed '2i insert str'
sed '2,5c No 2-5 number'
sed -n '5,7p' sed -n '/test/,/check/p' sed -n '5,/^test/p'
sed -n '/root/p' sed -n '/root/{s/bash/blueshell/;p}' sed '/test/,/check/s/$/test/' sed -n '/root/{s/bash/blueshell/;p;q}' sed 's/oldstr/newstr/g' sed 's/正则//g' sed -n 's/^test/my&/gp' sed -n 's/\(love\)able/\1rs/gp' love标记为1 sed 's/s/S/1' my.txt sed 's/s/S/2g' my.txt
sed -e '3,$d' -e 's/bash/blueshell/' sed '3,$d; s/bash/blueshell/'
sed -i 's/\.$/\!/g' sed -i '$a str'
sed '/test/r file' sed -n '/test/w file'
sed '/test/{n; s/aa/bb/g;}'
sed '1,10y/abcde/ABCDE/'
sed '10q'
|