VI Editor
In Unix or Linux Operating systems, we use VI editor to create scripts or make changes to configuration files or programs.Below commands might be useful for you at the initial stages.
Procedure to create or edit file is as shown below.
- Open the terminal application in Linux or Unix
- Next, open a file or create a file in vi, type: vi filename
- To save a file in vi, press Esc key, type :w and hit Enter key
- One can save a file and quit Vi by pressing Esc key, type :x or :wq! and hit Enter key.
- If you do not want to save any changes, first press Esc key. To exit Vi without saving changes press :q! followed by ENTER key
Summary of vim/vi commands
Command | Description |
---|---|
Press the ESC key Type :q! Press the ENTER key | Exit vim without saving changes i.e. discards any changes you made. |
Press the ESC key Type :wq Press the ENTER key | Save a file and exit. |
Press the ESC key Type :x Press the ENTER key | Save a file and exit. |
Comments
Post a Comment