插入:
sed -i '/dbu reg ini ip/ i\
xxx
xxx
xxx\
' file
前面加#注释几行:
sed -e '433,436s/\(^[^#].*\)/#\1/g' ${FILENAME}
可以加-i直接修改文件。
删除几行
num=`sed -n "/Application (/=" $FILE`
endno=`expr $num+4`
sed -i "$num,${endno}d" $FILE
=表示打印行号 -e cmd -i修改文件 -n silent
sed ‘s/\\/\//g’
find `echo $PATH|sed 's/:/ /g'` | more