linux如何删除多个文件中的指定行

有多个shtml文件,我想删除<metahttp-equiv="Expires"CONTENT="-1">这一行。[niexin@localhostsource]$gre... 有多个shtml文件,我想删除<meta http-equiv="Expires" CONTENT="-1">这一行。
[niexin@localhost source]$ grep -rni "content=\"-1\"" user/lighttpd-1.4.20/www_avantec/
user/lighttpd-1.4.20/www_avantec/wireless/basic.shtml:1897:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wireless/security.shtml:1534:<meta http-equiv="Expires" CONTENT="-1">
user/lighttpd-1.4.20/www_avantec/wireless/wps.shtml:386:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wireless/advanced.shtml:901:<meta http-equiv="Expires" CONTENT="-1">
user/lighttpd-1.4.20/www_avantec/wireless/apstatistics.shtml:184:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wireless/wds.shtml:443:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wireless/wapi_cert_user_upload.html:48:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wireless/htmode.shtml:1896:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wireless/wapi_cert_as_upload.html:48:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wireless/apcli.shtml:532:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wireless/wmm.shtml:668:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wireless/stainfo.shtml:150:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/basic.shtml:1897:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/security.shtml:1534:<meta http-equiv="Expires" CONTENT="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/wps.shtml:386:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/advanced.shtml:900:<meta http-equiv="Expires" CONTENT="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/apstatistics.shtml:183:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/wds.shtml:443:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/htmode.shtml:1896:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/apcli.shtml:531:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/wmm.shtml:668:<meta http-equiv="Expires" content="-1">
user/lighttpd-1.4.20/www_avantec/wifi2/stainfo.shtml:152:<meta http-equiv="Expires" content="-1">
[niexin@localhost source]$
展开
 我来答
淘气的峰
2015-11-09 · TA获得超过1729个赞
知道小有建树答主
回答量:1046
采纳率:0%
帮助的人:873万
展开全部
sed -i '/meta http-equiv/'d my.txt
追问
怎么一次性删除这些文件里的这些行啊?
追答
都说了这个命令
sed -i '/meta http-equiv/'d my.txt
meta http-equiv换成你要删除的行包含的字符串
my.txt换成你的文件名,你如你文件名是test1 test2...你就换成test*表示全部含有test关键字的文件
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
良玉小帝
2015-11-09 · 个人日常精心汇总合集
良玉小帝
采纳数:5925 获赞数:9451

向TA提问 私信TA
展开全部
那么多。。。
sed '/<meta http-equiv="Expires" CONTENT="-1">/d' file
追问
怎么一次性删除这些文件里的这些行啊?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式