Tuesday, October 2, 2007

Unix Command Samples - Sed

Display file without the blank lines and remove the first line:
$ cat bearish.htm | sed -e '/^ *$/d;1,1d'

Remove first 3 lines in a file:
$cat bearish.htm | sed -e '1,3d'

Remove HTML tags:
$cat bearish.htm | sed -e 's/<[^>]*>//g'

No comments: