Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to have a shortcut for a command:

sudo nautilus "/"

I tried to set it in Keyboard->Shortcuts->Custom Shortcuts but it didnt work.
I also created shell file with this command and put it(sh there but it also didnt work. When I set there only nautilus it works but this is not what I want.

Does anyone know how can I create shortcuts for a custom command like this?

share|improve this question
up vote 3 down vote accepted

As sudo will require you to enter your password, it probably isn't "working" because you're not running it in a terminal.

To run from the GUI instead, you should use gksudo rather than plain sudo. This will present a graphical dialog for you to enter your password with, to authenticate running as root.

Also note, that it probably won't work as you expect. You'll want the --no-desktop option passed to nautilus, otherwise you'll see the root user's background rather than yours.

share|improve this answer
"gksudo" works very well for me. Thank you dobey! – madox2 Oct 21 '12 at 14:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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