I edited the hosts file at /etc/hosts , do I need to restart the service for my changes to take effect?
No, it's not necessary. You don't even need to restart the browser. The effects should take place as soon as you refresh or load a web page.
On each DNS request the hosts file is read. This means it is not saved to memory, so the changes you make are in real time. Your machine checks the hosts file first. If a mapping is not found for a hostname, then it asks your DNS server.
My personal Linux notes, a work in progress, shared online with the world. From intro to pro Linux Administration.
Showing posts with label edit file. Show all posts
Showing posts with label edit file. Show all posts
Thursday, January 3, 2013
Friday, December 28, 2012
How to Exit vi
Press escape to get into command mode if you re not already in command mode (i.e. if you are in insert/edit mode) .. Even if you are not in the edit mode press escape any way, it s OK.
So, press esc, then
type one of these:
:q to quit and dont save
:q! to quit with out saving changes or prompts (if you have made changes)
:w to save
:wq to save and quit
:x to save and quit
emacs - ^X^S to save, ^X^C to quit
esc shift^ZZ to save and exit.
Notes:
Adding an exclamation mark at the end of the command means "do it!" - as in :q!
When you will press escape the "insert" mode will be disabled, then you need to type : After that you can provide q! or w or wq and hit enter.
So, press esc, then
type one of these:
:q to quit and dont save
:q! to quit with out saving changes or prompts (if you have made changes)
:w to save
:wq to save and quit
:x to save and quit
emacs - ^X^S to save, ^X^C to quit
esc shift^ZZ to save and exit.
Notes:
Adding an exclamation mark at the end of the command means "do it!" - as in :q!
When you will press escape the "insert" mode will be disabled, then you need to type : After that you can provide q! or w or wq and hit enter.
Labels:
edit file,
Exit,
exit without saving,
Quit vi,
save and exit,
vi,
vi Editor,
vim
Subscribe to:
Posts (Atom)