Linux sed神器

sed -i -c -e '/^#/d'去掉注释行
sed -i -c -e '/^$/d'去掉空行
sed -i -c -e '/^$/d;/^#/'同时去掉空行和注释行
sed -i 's/^/HEAD&/g' passwd 在每行的头部增加HEAD
sed 's/$/&TAIL/g' test.file
sed -i '1!G;$!h;$!d'把文件内容倒序
后续持续更新。。。。。。

猜你喜欢

转载自www.cnblogs.com/flagsky/p/9167445.html