Your Question: How Do I Edit a File in Linux Vi?
Contents How Do I Open and Edit a File in Vi? to Open a File in the Vi Editor to Start Editing, Simply Type in ‘Vi ’ in the Command Prompt. to Quit Vi, Type...
Contents
How do I open and edit a file in vi?
To open a file in the vi editor to start editing, simply type in ‘vi <filename>’ in the command prompt. To quit vi, type one of the following commands in the command mode and press ‘Enter’. Force exit from vi even though changes haven’t been saved – :q!
Must Read
How do I edit a read only file in Linux VI?
How to open a file in readonly mode:
- Use view command within vim. The syntax is: view {file-name}
- Use vim/vi command line option. The syntax is: vim -R {file-name}
- Modifications not allowed using command line option: The syntax is: vim -M {file-name}