Monday, September 13, 2010

sed one-liners

To select a the portion between two keywords

sed -n '/word1/,/word2/p'

selectes the text between word1 and word2 and prints them. Nothing is printed on-screen if the "p" is omitted.

To select the inverse of that or to delete those lines between word1 and word2use "!p".


sed -n '/word1/,/word2/!p'


Also see : http://www.catonmat.net/blog/sed-one-liners-explained-part-three/

No comments:

OK GOOGLE on Samsung Galaxy S7 doesn’t work

To make Ok Google detection work on Galaxy S7 (Galaxy series phones) we need to perform a couple of steps. 1. As long as Samsung S vo...