Thursday, May 2, 2024
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 5314  / 3 Years ago, sat, july 24, 2021, 1:07:05

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 <application> it can automatically convert that to gksu <application> 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!)?


More From » command-line

 Answers
3

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


[#30506] Saturday, July 24, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eanda

Total Points: 439
Total Questions: 116
Total Answers: 105

Location: Armenia
Member since Sat, Dec 31, 2022
1 Year ago
eanda questions
Tue, Nov 22, 22, 15:24, 1 Year ago
Sat, Oct 16, 21, 23:48, 3 Years ago
Sun, Jul 3, 22, 09:38, 2 Years ago
Thu, Feb 3, 22, 14:33, 2 Years ago
;