1. 程式人生 > >使用sed輸出檔案的指定行

使用sed輸出檔案的指定行

sed ‘/pattern/!p’ infile //匹配pattern的行不輸出
sed -n ‘1,2p’ infile //print line 1 to 2
sed -n ‘2,$p’ file //print line 2 to end of line