3 Feb 2010

Edit files remotely via VIM & SCP

Author: admin | Filed under: General Info

if you need to make an edit to a file on a remote server simply

vim scp://hostname.example.com//path/to/file.txt   (will require username on remote host to be the same as what you have on screen)
root@g33k4l1f3.com's password:    (enter pw)
Press ENTER or type command to continue   (hit enter, file opens, make edits, then save and close)
:wq
root@g33k4l1f3.com's password:    (enter pw)
#

Or, if you need to connect as a different user:

$ vim scp://user@hostname.example.com//path/to/file.txt

If you need to specify an alternate port, use the familiar colon (:) syntax:

$ vim scp://user@hostname.example.com:5757//path/to/file.txt

That’s all there is to it! The file is read into VIM from the remote system, if it exists. Then, you are free to make changes. When you save, changes are written to the remote system.

4 Responses to “Edit files remotely via VIM & SCP”

  1. Valda Averitte Says:

    I dugg some of you post as I cerebrated they were very helpful extremely helpful

  2. Connie Binn Says:

    Its fantastic as your other posts : D, appreciate it for putting up. “There’s no Walter Cronkite to give you the final word each evening.” by William Weld.

  3. Banqueting halls in London Says:

    What a great post. Thank you and keep up the great work!

  4. Conference venue in London Says:

    Another great article.

Leave a Reply