21

I'm new to linux and the terminal. As I learn how to use the terminal to navigate through directories, I like to use the gui file explorer to mirror my terminal navigation. The icons and file extension info in the gui file explorer help me figure out what everything is. However, I can't access the root folder via the gui, I can only access it via the terminal. Is there a way to enable access to the root folder outside of the terminal?

aaachilless
  • 351
  • 1
  • 2
  • 4

5 Answers5

34

Try one of the below commands,

gksu nautilus

or

sudo -i nautilus

It is an GUI way of navigating through directories with root access.

Avinash Raj
  • 78,556
  • According to this link, gksu and sudo are about the same: http://unix.stackexchange.com/questions/66479/what-is-the-difference-between-gksu-and-sudo – Dan Johansen Feb 19 '14 at 05:01
  • @DanJohansen Sure they are not when dealing with GUI. Read the answer in link above and you will understand why and note that we are Ubuntu so i recommend you just to link to askubuntu answers when you want to do that – Maythux Feb 19 '14 at 05:03
  • 1
    @maythux It is obvious that he should never use sudo rights with a GUI application, but it is what he was asking for to do. he can seriously mess up his system by doing so, I know, but that doesn't make my statement false, that gksu is a wrapper for sudo, therefore almost the same. – Dan Johansen Feb 19 '14 at 05:07
  • @maythux the answer Dan linked links backs to us http://askubuntu.com/a/11831/169736 which essentially says the same. gksu/do is just a wrapper for sudo – Braiam Feb 19 '14 at 05:38
  • @Braiam I didn't say that is not true. But you know sudo with GUI is just a very BAD habit and should never use it this way else why the make gksu!! – Maythux Feb 19 '14 at 05:41
  • 1
    @maythux in that case tell that to OP who's asking, don't start a discussion where the answer clearly tells how could be done, when your own don't even include a warning about the dangers of using nautilus (or any file manager) as root. – Braiam Feb 19 '14 at 05:48
  • @AvinashRaj gksu need to be installed. I think nowadays it does not come with default installer. – sourav c. Feb 19 '14 at 08:06
  • i think gksu nautilus is what i was looking for, as it seems like a safe-ish version of sudo nautilus – aaachilless Feb 20 '14 at 05:57
  • Plain sudo nautilus did the job for me in Ubuntu 16.04 - August 2017. – SDsolar Aug 14 '17 at 18:50
  • thanks save me alot of research after testing every linux permissions – zero8 Apr 25 '20 at 15:09
6

Open terminal and type

sudo nautilus

Enter your password and voila it works.

d a i s y
  • 5,511
rkmrajan
  • 61
  • 1
  • 4
  • THAT'S IT! It didn't even ask for my password. It just worked. Now if I only knew how to make it an icon. Thank you from August 2017. – SDsolar Aug 14 '17 at 18:46
1

From terminal so from terminal you can do it with the command

gksu nautilus

This will prompt you to password. Enter your sudoer user password and this will open the root home directory.

If you want to open a specific path as root

gksu nautilus /path-you-want

EDIT: You can also install Open-as-Administrator in Ubuntu open Terminal (Press Ctrl+Alt+T) and copy the following commands in the terminal:

sudo add-apt-repository ppa:noobslab/apps

sudo apt-get update

sudo apt-get install open-as-administrator

After installation type this command to restart Nautilus:

nautilus -q

enter image description here

and now you can open any directory with root permissions

source

Maythux
  • 84,289
  • That installation threw a ton of errors and never opened, in Ubuntu 16.04 (August 2017) - even the remove command threw up all over the screen. Plus then I had to delete that respository. NOT RECOMMENDED TO DO THIS -------> the simplest solution is to simply type sudo nautilus in terminal. It just plain works. – SDsolar Aug 14 '17 at 18:48
1

The simplest one I know is, killall nautilus; sudo nautilus

When you have decided to damage your files, all that I can do is either watch the fun or make things even worse by helping you.

Registered User
  • 9,631
  • 14
  • 53
  • 85
  • what is the harm by just navigating through root folder? and why you want to kill nautilus. sudo nautilus will open a different window with root access. – sourav c. Feb 19 '14 at 07:50
  • without root permission, one can't make a permanent damage to OS.using root, one can make it unbootable.I used killall nautilus because there is not much sense in loading two nautilus when you can use tabs.It's personal choice anyway. – Registered User Feb 20 '14 at 10:57
0

In terminal type "gksu nautilus".

(the gksu command can be used instead of sudo when wishing to run gui apps as root, though you should be cautious about what apps you run as root).

or

In terminal type "sudo -i" then "nautilus".

(works, but you will recieve some errors, and it's not a good idea as gui applications should use gksu)

or

In terminal type "sudo nautilus".

(works, but you will recieve some errors, and it's not a good idea as gui applications should use gksu)

mango
  • 286
  • 1
  • 4