[英]How to use the sed command to delete a line from a file
Hello I am trying to delete a line from my file but I keep getting this error when i run the command below: sed: -e expression #1, char 1: unknown command您好,我正在尝试从文件中删除一行,但是当我运行以下命令时,我不断收到此错误: sed: -e expression #1, char 1: unknown command
Here is an example of what I am trying to do这是我正在尝试做的一个例子
sed -i 'something'/d "home/file/something.txt"
What am I doing wrong?我究竟做错了什么?
You need /
at the beginning of the pattern.您需要/
在模式的开头。
sed -i '/something/d' "home/file/something.txt"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.