Hello, please sign in or register
You are here: Home

vi - File Open Edit Write Delete and Save tools

To simply open a file without editing use less filename ¿½ if you want to edit, forget this.

From command line, to open a file for editing type vi filename

You¿½ll see the top of the document and... ¿½--- More---¿½ ...at the bottom, press <return> and you¿½ll see a few options at the bottom like [O]pen, [E]dit ¿½ etc. Press ¿½e¿½ to view and edit this document. You¿½ll now have a view of the top part of the document, use the page up and down and return to scroll down. Alternatively press <shift> + ¿½g¿½ to go to the bottom of the page.

To edit press ¿½i¿½, you will now see... ¿½---INSERT---¿½ ...written at the bottom of page. Use the arrow keys to move in the document. And write and use delete key as normal editor. To leave edit mode press ¿½>Esc<¿½

Then you can¿½
Save and exit type :wq i.e. colon write and quit
Exit without saving just type ¿½:q¿½ depending on which method you opened the document with you might be asked to enforce this with a following ¿½!¿½ i.e. type :q!

From command line, to delete a file type rm filename

Comments

Title*
Comment

Prove you are not a robot

To prove you are not a robot, please type in the six character code you see in the picture below
Security confirmation codeI can't see this!
Contact
Name*
Email never shown*
Home Page

Author

Andrew Dodson
Since:Feb 2007

Comment | flag

Categories

Bookmark and Share