1

I'd like to replace Music by Music/Oliver

The command:

find ./ -type f -exec sed -i 's/Music/MusicOliver/gI' {} \;

How do I insert the / without interrupting the command? I've tried with "string" and 'string' but it didn't work.

Thanks for your hints!

Schöbi
  • 25
  • 2
  • This is a partial duplicate of ["Escaping forward slashes in sed command"](https://stackoverflow.com/questions/40714970/escaping-forward-slashes-in-sed-command), ["sed with arbitrary variables that might contain slashes"](https://stackoverflow.com/questions/21693524/sed-with-arbitrary-variables-that-might-contain-slashes), ["Escape a string for a sed replace pattern"](https://stackoverflow.com/questions/407523/escape-a-string-for-a-sed-replace-pattern), and many others. – Gordon Davisson Oct 13 '22 at 00:11

1 Answers1

1

You can use a different delimiter for sed command like

find ./ -type f -exec sed -i 's|Music|Music/Oliver|gI' {} \;
Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134