permission denied when redirecting sudo sed output

9,337

The tutorial does not use sudo and requires a root shell. You can get a root shell with sudo -i.

In case you prefer sudo, the redirection is handled by the shell and not by the sudo command. So you can't create a file in /etc/apache2/sites-available by directing the output as you did. According to the sudo manual, you should use a subshell like:

$ cd /etc/apache2/sites-available
$ sudo sh -c "sed 's/www/www\/drupal/g' default > drupal"
Share:
9,337

Related videos on Youtube

Bodhidarma
Author by

Bodhidarma

I started learning php about two weeks ago. I suck at it.

Updated on September 18, 2022

Comments