You can open/edit file in linux using vi editor
Syntax:
Examples:
Note: If you are in insert mode and want to close file, then press Esc key first.
Syntax:
- vi [options] <file name or path to file> then press 'i' to open in insert[edit] mode
Examples:
- vi file1
- vi /tmp/file2
To close opened file, follow below commands of vi editor:
- To save file, type:
- :wq<Enter Key>
- To save file forcefully, type:
- :wq!<Enter Key>
- To close file without saving, type:
- :q<Enter Key>
- To close file forcefully, type:
- :q!<Enter Key>
Note: If you are in insert mode and want to close file, then press Esc key first.
No comments:
Post a Comment