Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
61
rated 0 times [  61] [ 0]  / answers: 1 / hits: 88002  / 3 Years ago, tue, july 20, 2021, 1:14:08

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/?


More From » vim

 Answers
1

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.


[#29901] Tuesday, July 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ainsbeave

Total Points: 280
Total Questions: 98
Total Answers: 105

Location: Faroe Islands
Member since Sat, Aug 20, 2022
2 Years ago
;