Your expression is not entirely correct. You need to say sed 's/pattern/replacement/g' file
. Or, using another delimiter if /
is in the pattern and you don't want to escape it, sed 's#pattern#replacement#g' file
(or any other).
Also, the usage of \
may mislead sed
, since it escapes the character after it. If you want a literal one, you have to escape it.
So you need to say something like:
sed 's#href="../../../../file/old.html"#c\\#g' file
# ^
# double \ so that you have a literal \
Let's test it:
$ cat a
hello <a href="../../../../file/old.html">bye</a>
hehehe
$ sed 's#href="../../../../file/old.html"#c\\#g' a
hello <a c\>bye</a>
hehehe