How to delete line from file using sed command?

hello Team,

I want to delete below linux using sed command but I am getting error.

sed -i '/url=[htmlcgi]/status.cgi?hostgroup=[hostgroup_name]/d' 3

error:

sed: -e expression #1, char 32: unknown option to `s'

Could you please help me with correct syntax.

My line contain / character because of that I am getting error.

Hi,

You can escape the forward slash, to do this you should use a back slash like \/url........

So use

sed -i '\/url=[htmlcgi]\/status.cgi?hostgroup=[hostgroup_name]\/d' 3

Regards

Gull04

I am getting below error

sed -i '\/url=[htmlcgi]\/status.cgi?hostgroup=[hostgroup_name]\/d' 3
sed: -e expression #1, char 57: unterminated address regex
sed -i '/url=\[htmlcgi\]\/status.cgi?hostgroup=\[hostgroup_name\]/d' 3

Thanks @balajesuri its working on.