Tuesday, May 22, 2018

VI Command


To use vi: vi filename.      -->this is a command to open a file
To get insert mode of vi: i. -->enter i to change vi mode to insert for making changes to file
To enter vi command mode: [esc] Counts -->enter esc if you are done with changes in insert mode 
                                                                          and if u want to exit(you have to run below commands                                                                            for exiting after clicking esc)
To exit vi and save changes: ZZ or :wq. --> This is a command to close a file with saving
To exit vi without saving changes: :q!   -->This is a command to close a file with out saving