1

my config file has this

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

I want to change "index.php" to "index.temp"

I created this

sed -i -e '/s/index.php/index.temp/‘ dir.conf

It makes this,

<IfModule mod_dir.c>
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
ndex.php/index.temp/
  • 4
    You presumably want to use the s substitute command, so do not begin with / as /s/ means match the pattern s, and then the command is i which inserts the rest of the line. So use sed -i -e 's/index.php/index.temp/' – meuh Nov 3 '18 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.