Vi (Vim) File Saving Related Commands
Many times, after we opened a file using Vi, we may want to open another file or save the file into another location.
Here are the commands:
Press [Esc] key, then press colon (:), at the left corner of your editor, you can type the following commands to save the file.
| Command | Description |
| q | Quit |
| q! | Quit without saving changes i.e. discard changes |
| r fileName | Read data from file called fileName |
| wq | Write and quit (save and exit) |
| w fileName | Write to file called fileName (save as) |
| w! fileName | Overwrite to file called fileName (save as forcefully) |
Reference: https://bash.cyberciti.biz/guide/Hello,_World!_Tutorial











