Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-24-2009, 07:05 PM   #1
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49

Rep: Reputation: 15
I want to remove the comment in the hosts file, is this ok?

As the title suggests, I want to remove the last comment in the /etc/hosts file, so that I can add new lines and not have to write anything intricate to replace the last comment, which is merely:

#End of hosts file
...or something similar.

Will doing this cause any errors?
Old 11-24-2009, 07:24 PM   #2
Registered: Jul 2009
Distribution: Arch / Mint 17
Posts: 297
Blog Entries: 3

Rep: Reputation: 50
Try it and find out. It's only /etc/hosts.
Old 11-24-2009, 07:54 PM   #3
Registered: Jun 2008
Posts: 405

Rep: Reputation: 31
It almost certainly won't cause any problem. Back up the file, remove the line and reboot to see what happens.

The only time I've heard of a commented line actually mattering is the first line of a script file which tells it what shell to run under despite starting with #
Old 11-24-2009, 08:12 PM   #4
Senior Member
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
You can safely remove that line its just a comment telling you you have reached the end of the file. It is not used in hosts at all.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
About hosts file ! shipon_97 Linux - Newbie 3 10-13-2009 04:14 AM
How to tell what process last wrote to a file? - hosts file being updated by unk kcoriginal Linux - General 1 12-29-2008 12:53 AM
Is there a way to filter out all the comment lines in a configuration file... Akhran Linux - Newbie 3 12-07-2005 12:07 PM
Want to remove a kernel that always hang, where do I comment it out? Niceman2005 Linux - Newbie 3 01-13-2005 01:35 AM
does the /etc/hosts file work same as the M$ hosts file? Lleb_KCir Linux - Software 6 04-03-2004 05:33 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration