I want to change in file /var/www
with /home/lokesh/www
with sed
command
sed -i 's///var//www///home//lokesh//www/g' lks.php
but this give error
sed: couldn't open file ww///home//lokesh//www/g: No such file or directory
quotingsed
I want to change in file /var/www
with /home/lokesh/www
with sed
command
sed -i 's///var//www///home//lokesh//www/g' lks.php
but this give error
sed: couldn't open file ww///home//lokesh//www/g: No such file or directory
Best Answer
Not sure if you know, but
sed
has a great feaure were you do not need to use a/
as the separator.So, your example could be written as:
It does not need to be a
#
either, it could be any single character. For example, using a3
as the separator: