I want to replace a string (which is a name of a directory) like "/home/xyz/", to "/home/abc/" in multiple files through terminal. Usual replace command like sed does not seem to work with "/". Can anyone suggest anything ?
Asked
Active
Viewed 35 times
1 Answers
0
Sed works just fine on strings with slashes. Just a) escape the slashes or b) pick a different delimiter that's not part of the string.
echo "/home/xyz/"|sed 's@/home/xyz/@/home/abc/@'

tink
- 14,342
- 4
- 46
- 50