I am trying to copy a .php file from my Documents directory to /var/www/html. I would do this in the GUI, but I don't have root access, only in the terminal. How would I go about doing this?


You can always run your file manager with root privileges. Please be careful, though. There's nothing stopping you from killing your installation if you do this.

The recommended method is to use gksudo. If you have Unity or GNOME, the command is:

gksudo nautilus

You'll get the file manager with root privileges. If you don't have Nautilus, you can try caja or dolphin.

If you don't want to install gksudo, you can also do:

sudo -H nautilus

This uses root's configuration to open Nautilus, which prevents potential permission errors when saving configs.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.