1.substitute CA with California
s/CA/California/g
2.delete all line
d
3.delete 1st line
1d
4.delete last line
$d
5.delete blank line
/^$/d
6.delete lines in 2 regular expression block
/^\.TS/,/^\.TE/d
7.delete from 50 to the last line
50,$d
8.delete line 1 to a blank line
1,/^$/d
9.delete all line except 2 regular expression block
/^\.TS/,/^\.TE/!d
10.delete blank lines within 2 regular expression block
/^\.TS/,/^\.TE/{
/^$/d
}
11.execute multiple commands within 2 regular expression block
/^\.TS/,/^\.TE/{
/^$/d
s/^\.ps 10/.ps 8/
s/^\.vs 12/.vs 10/
}
阅读(1026) | 评论(0) | 转发(0) |