How to create new files as root user from the Raspberry Pi OS Desktop
Sometimes, you want to be able to edit and create system files on Raspberry Pi OS. I’ll show you how to do this using pcmanfm, the file system browser you already know on the Raspberry Pi.
First, you’ll need to open the file browser in super user mode
Click on Raspberry Pi OS Menu, and here click the “Run …” command:
Run pcmanfm as root (sudo pcmanfm) by typing “sudo pcmanfm” (without the quotes) in the dialog which opens, and clicking on OK:
A new window opens, showing you the contents of the /home/pi directory:
Note: you should see this icon, just under the “File” menu. It indicates that you are using pcmanfm as user root, and should therefore be extra careful (since root can edit / delete / move any file! even files which are critical for a normal system operation).
As an example, if you wish to create a new configuration file for PiControl, you could navigate to the following directory on your Raspberry Pi:
/etc/picockpit-client/apps/com.picockpit/picontrol/modules
Tip: you can also copy & paste the path I’ve given above, and hit the enter key to navigate to the directory.
Raspi Berry’s helpful Raspberry Pi tips
right-click into the empty area next to the existing files, and select “New File…”.
For example, if you want a new file “ssh-server.json”, you’ll type:
Using the menus of pcmanfm you can also delete files, copy and move them.
You can learn more about pcmanfm here.
I hope this helps new users needing to edit system files as root on the Raspberry Pi 🙂