Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 8854  / 2 Years ago, sat, october 15, 2022, 3:12:57

I want to be able to easily and frequently edit my hosts file from a quick GUI. Any one know of one that exists?



Thanks!


More From » gui

 Answers
7

As already answered hosts is just a text file so you can use any text editor. Since it exists in /etc and you cannot edit as general user you need to use sudo. The graphical frontend to sudo is gksu. So basically doing gksu YOUR_GRAPHICAL_EDITOR /etc/hosts will do it OR you can use terminal with nano and vim. I recommend nano as it is quite easy.



sudo nano /etc/hosts



In order to ease the command you can use alias.



So edit your .bashrc file in your $HOME. i.e.
In your terminal do:



nano .bashrc 


Add



alias edithosts='gksu YOUR_GRAPHICAL_EDITOR /etc/hosts' OR 'sudo nano/vim/vi /etc/hosts'


and save it with Ctrl+x. And do source ~/.bashrc. Then you can use edithosts from commandline to use it.



If you use unity you may use quicklist as well What Custom Launchers and Unity Quicklists are available?


[#39770] Monday, October 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sconhoney

Total Points: 403
Total Questions: 118
Total Answers: 109

Location: Andorra
Member since Mon, Jan 9, 2023
1 Year ago
sconhoney questions
;