How to open folder as root?

This thread could have been posted elsewhere… but seeing that i want to get better acquainted with Manjaro MATE (a new experience for me), was wondering how to enter a system file as root?

Much obliged!

In thunar, the filemanger from xfce, you just right click the folder and select open as administrator.
Fill in your root password and voila.

Good luck

Can it be done with CAJA?

Other way is open terminal type sudo (to get root privileges) and type in the name of you filemanger. and voila the filemanager will open with root priveleges.

3 Likes

@MGrider you da man (or gal)!

Thanks! :grinning:

p.s. it helps me to insert a file with code in X11 folder to fix screen tearing issue (just in case someone stumbles on this post).

Except you shouldnt do that. Its bad practice, can easily lead to broken permissions, and hands over sudo privileges to all of X window manager. Dolphin for example flat out disallows you from doing so.

1 Like

So, the right solution to open a single folder would be…?

You dont want to ‘open a folder’, you want to edit a file, right?

You can navigate to that directory using your regular file manager. Or if you were using terminal is would be cd … you dont need root to just navigate there.

Back to the file. If you use a polkit compliant editor (such as kate) then you need not do anything … simply open the file and edit and save … it will ask for a password if needed.
If you dont have one of those then the answer is terminal and/or sudoedit.

sudo nano /path/to/file
sudoedit /path/to/file
EDITOR=nano sudoedit /path/to/file

Have to open a folder within the system, to insert a “text” file in it.

Have tried with Pluma (default installed app) and it seems to do the trick as well.
Had i known!!

Answered 3 ways above.

1 Like

Nemo & Nautilus have option to open as admin (mouse right clicking)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.