![]() ![]() If you are using Nautilus consider the extension Edit as Administrator which dramatically improves your workflow: You are using option 2 but I prefer option 4 sudo -H gedit which allows relative path when editing a root owned file. Pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gedit My researchs brought me these proposals, are they equivalent or to be The pwd command returns the current directory so you can embed it in your command line: gedit admin://$(pwd)/rootfilenameĪs this question Which best practice for using gedit as root? points out: This small python extension integrates in the right-click menu, and converts the selected file to an 'admin://' URI for editing with root permissions. Install it with the command sudo apt install nautilus-admin or using Synaptic Package manager (unfortunatelly, you cannot find it using Software). You can install the nautilus python extension, nautilus-admin. Or gedit admin://$(readlink -f ubuntu.css)` You could avoid typing the path using $(pwd)filename or $(readlink -f filename). This can make it easier to enter the URI in the terminal. Thus, you could type "gedit admin://' in the terminal, find the file in Files, and then drag the file from Files into the terminal. You could drag the file from Files (nautilus) into the terminal. You can use Tab expansion once you typed the three slashes of the URI. Other, more standard options to not to have to type the pathname are: Also providing the full path, or any valid path, will work. If you place that in a folder in your path, the command sedit ubuntu.css will open the file using the admin URI. With the script sedit, you edit a file correctly with administrator privileges, just by typing the command and a filename, as in sedit ubuntu.css. You can, however, very conveniently work around the issue with a wrapper script. This answer may be disappointing, but that is how it currently (Ubuntu 18.04, Ubuntu 19.10) works. Unfortunately, no, it is not possible to pass a relative path with this admin:// URI. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |