Saturday, March 24, 2018

command line - How can I run sudo gedit as gksu gedit



I'm looking into ways of automatically loading Gedit as gksu gedit when I enter sudo gedit by mistake?



I have found that I have made a number of files unreachable by using gedit and I have only just found out why!



ACHIEVED SO FAR



I have written a script which will make an alias so that if I type in sudo it can automatically convert that to gksu but I want to make this alias stick, so that I don't have to run the script every time I boot the computer.




Is there a config file I can edit or should I run this script as a start up script (which would be inconvenient!)?



Open .bashrc file
gedit ~/.bashrc



Add following alias
alias sudo='gksu'



Now restart terminal to start using the alias.



Only add alias gedit='gksu gedit' if you want gksu only for gedit.
echo 'alias gedit='gksu gedit' >> ~/.bashrc



No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...