How To Use Vi Editor In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. To open the vi editor, type in the terminal window: vi <filename>.
2. To enter the command mode, press the ‘Esc’ key.
3. To enter the insert mode, press the ‘i’ key.
4. To save the file, type ‘:w’ followed by Enter.
5. To quit the editor, type ‘:q’ followed by Enter.
6. To quit the file without saving, type ‘:q!’ followed by Enter.
7. To undo changes, type ‘u’.
8. To delete a single character, press the ‘x’ key.
9. To delete a line, type ‘dd’.
10. To copy a line, type ‘yy’.
11. To paste the copied line, type ‘p’.
12. To search for a word, type ‘/<word>’ followed by Enter.
13. To move to the beginning of the line, press the ‘0’ key.
14. To move to the end of the line, press the ‘$’ key.
15. To move to the next word, press the ‘w’ key.
16. To move to the previous word, press the ‘b’ key.