Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How do I modify my hosts file?

user-image
Question ajoutée par Zaid Rabab'a , Software Development Team Leader , Al-Safa Co. Ltd.
Date de publication: 2013/12/10
Asif Ali M
par Asif Ali M , Project Lead , LiquidHub

you should have root access or you should be the sudo user to modify.

The default location of the file in linux is /etc/hosts to modify

 

open a terminal then type "sudo vi /etc/hosts"

 

sherin villannassery
par sherin villannassery , Software Engineer , Ti Technologies

The owner of a file/directory, use chown. For example:

sudo chown your_username file_or_directory

Check man chown and man chmod for more information.

But, be careful, it is not a good idea to became the owner of a system file/directory! So, if you want to edit a system file is not necessary to be the owner of that file. Just use in terminal:

sudo -i # to grant access as root gedit file_name # or /path/to/file/file_name

After you finished to edit your file, press Ctrl+D in terminal to exit from root session.

Clodelio Delfino
par Clodelio Delfino , Managing Consultant , Startup Company

in windows:

systems32/drivers/etc/host

 

in linux:

/etc/hosts

 

Any text editor will do the job as long as you have privilege or access to modify it. e.g. root, administrator.

for what purpose do you need to modify file.. there is a seperate files for each thing and it depends on linux flavor as well. more or else all of them has same file naming convention but you need to be specific about this your requirement. 

 

 

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?