Pete Pete - 1 year ago 98
Bash Question

Delete all lines containing a caret (^)

I tried

sed -i '/^/d' myfile
and it deleted the entire file. How to avoid this? I want to remove all lines with
^
in it.

Answer Source
sed -i '/\^/d' myfile

You need to escape the ^ special character.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download