Monday, January 14, 2013

sed 匹配

sed -n ‘/pattern/w   newfile'  oldfile

匹配 pattern的行,输出newfile

awk '/A/||/B/||/C/{print}' test >newfile

匹配 A或者B或者C的行 输出 newfile

No comments:

Post a Comment