Access files as an administrator.
Wagner Luís de Araújo Menezes Macêdo
wagnerluis1982@gmail.com 2007
Pedro Vaz de Mello de Medeiros
pedrovmm@gmail.com 2007
Leonardo Ferreira Fontenelle
leonardof@gnome.org 2007, 2008
Vladimir Melo
vmelo@gnome.org 2008
Fabricio Godoy
skarllot@gmail.com 2008
Krix Apolinário
krixapolinario@gmail.com 2009
José Carlos Menezes
jcmenezes.91@gmail.com 2013
Enrico Nicoletto
hiko@duck.com 2013, 2014, 2022
Rafael Fontenelle
rafaelff@gnome.org 2013-2020
Bruno Lopes
brunolopesdsilv@gmail.com 2021.
Giovanni dos S.A.L Rodrigues
giovannilombone.io@gmail.com 2024

# Edit a file with admin privileges

Editing files with administrator privileges is potentially dangerous, and may break your system in bad ways. Take great care.

The instructions below assume that Linux is used.

# If the file needs to be created

First, if the file doesn't exist yet, it needs to be created beforehand.

Open a terminal and execute a command like:

sudo touch /path_to_file

Replace /path_to_file with the desired path.

Example:

sudo touch /root/gedit-test

# Open an existing file

To edit an existing text file with gedit with admin privileges, open a terminal and execute a command like:

gedit admin:///path_to_file

Replace /path_to_file with the desired path.

To continue the example from the previous section:

gedit admin:///root/gedit-test

You will need to successfully enter the administrator password in order to open the file.

The gedit command needs to be executed as a normal, unprivileged user.