sed '/^[[:space:]]*$/d' filename
sed 's/\(<[^>]*>\)//g;/^[[:space:]]*$/d' file.html
[b:4c6c2a6554][color=red:4c6c2a6554]一. 替换[/color:4c6c2a6554][/b:4c6c2a6554]
sed 's/\[[^]]\{1,\}\]//g' filename
Month, Day, Year [A-Z][a-z]\{3,9\}, [0-9]\{1,2\}, [0-9]\{4\}
2003-01-28 或 2003.10.18 或 2003/10/10 或 2003 10 10
\([0-9]\{4\}[ /-.][0-2][0-9][ /-.][0-3][0-9]\)
\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\)
\(\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\)
[-+]*[0-9]\{1,\} 整数
[-+]*[0-9]\{1,\}\.[0-9]\{1,\} 浮点数
echo "WeLoveChinaUnix"|sed -e 'H;s/\(..\).*/\1/;x;s/.*\(.\{9\}\)$/\1/;x;G;s/\n/ /'
We ChinaUnix
echo 20030922|sed 's/\(....\)\(..\)\(..\)/\1 \2 \3/'|read year month day
echo $year $month $day
sed '1!G;h;$!d' oldfile >newfile
当然也可以直接使用tac命令实现倒序输出.