Connect to remote host:

ssh <username>@<remotehost>
password
cd <path-to-folder>

eg.
cd /var/www/vhosts/projectname
ls - for list of folders and files in current directory.

1) open a file

vi filename

2) search a text

/text
press 'n' for next

3) for edit/insert

press i than change file.

than ESC and use

:w - for save(write)
:x - for save & exit
:q - for quit
:wq - for save & quit
:q! - quit discarding changes

 

Advertisements