vi editor commands

1. Open a logs file in VI

root@doc16:/logs# vi logs.txt (vi )


2. To go to the start of the file
:0

3. To reach the end of file

Type G (Upper case)

4. To move forward by a page

Cntrl + F

5. To Move backwards by a page

Cntrl + B

6. Quit vi

:q

7. Search

/string search forward for occurrence of string in text
?string search backward for occurrence of string in text
 n move to next occurrence of search string
 N move to next occurrence of search string in opposite direction

8. Undo a change

:u

9. Quit vi editor without saving any changes
Press Escape key to change from insert or append mode
:q!

10. To go to the end of the current line

$

11. To start search from the last line

?(Search string)




No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days