日期:2014-05-16  浏览次数:20666 次

linux 删除文件一行操作
root@localhost ~]# cat file
hello world
a:b:c -h -n
a:b:c -h -n
[root@localhost ~]# sed -i '/a:b:c -h -n/d' file
[root@localhost ~]# cat file
hello world
[root@localhost ~]# sed -i 's/hello/baidu/' file.sh
[root@localhost ~]# cat file.sh
baidu world