I'm new in the world of ubuntu and vim editor.
My question is: how can I save a file on my localhost using vim?
When I use the command :w
I save the file, but where? And how can I change the file location to /var/www/
?
Ubuntu – Vim editor, how can I save a file in other directory
vim
Best Answer
You can enter
:pwd
to display the current working directory. This is where your file will be saved if simply enter:w filename
. You can change the working directory with:cd path/to/new/directory
. Or you can enter the full path to the location where you want to save the file with the write command, e.g.,:w /var/www/filename
.