Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
19
rated 0 times [  19] [ 0]  / answers: 1 / hits: 29098  / 3 Years ago, wed, september 15, 2021, 6:09:20

I have ubuntu 12.04 running in a virtual machine on virtual box. Its existence is mainly as a 'toy' to play about with Ubuntu, so for this reason I wanted the GUI (is that what 'Dash' is in ubuntu 12.04? Anyway...)



One thing I am currently using this machine for is a LAMP server. I use 'gedit' to edit my files, but because I haven't correctly set permissions yet I just open it with sudo in terminal.



Just now, to try to simplify this process I created a shell script on the desktop with a very simple job - sudo gedit



I can't help thinking there must be an even more obvious way to open gedit as root from the GUI than this. So is there?



Edit: I just 'improved' my script by replacing sudo with gksudo. Now I don't have to have a terminal window open while gedit is open. So I guess this is quite convenient for now :) It would be good, for the sake of knowledge, to know if this is anything close to how the more seasoned ubuntu users would do this type of thing.


More From » unity-dash

 Answers
2

Use gksudo gedit.



gksudo is the equivalent of sudo for graphical programs, which are not safe to run using sudo.


[#30334] Thursday, September 16, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ravturtl

Total Points: 335
Total Questions: 132
Total Answers: 110

Location: Tanzania
Member since Wed, Feb 24, 2021
3 Years ago
ravturtl questions
Wed, Feb 22, 23, 19:16, 1 Year ago
Fri, Dec 3, 21, 22:16, 2 Years ago
Wed, Nov 3, 21, 07:30, 3 Years ago
Wed, May 19, 21, 17:31, 3 Years ago
;