This page (revision-1) was last changed on 29-Nov-2024 16:16 by UnknownAuthor

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1 added 21 lines
!!Using __vi__ to Edit Text Files
Even the simplest administration tasks can be very difficult for technicians without UNIX experience. The reason? Editing a text file can be frustrating and time consuming if one has not yet been familiarized with an available text editor. One of the most commonly used and available: __vi__. __vi__ is elegantly simple, but brutally non-intuitive.
As daunting as it may seem, there are just 10 key combination to remember when editing text files on a server via SSH. Of course there are more for advanced functions... but you really only need these:
;(colon)q!:unconditionally quit (like when you really mess up and want to start over)
;Arrow keys:moves the cursor up, down, left, right (make sure you are not in INSERT mode!)
;i:enters INSERT mode, text typed will be placed at the cursor; press ESC to exit INSERT mode
;o:inserts a blank line after current line, enters INSERT mode; press ESC to exit INSERT mode
;A:jumps to the end of the current line to APPEND text to the line; press ESC to exit APPEND mode
;x:deletes the character at the cursor
;r''p'':replaces the character at the cursor with ''p''
;dd:deletes the entire line that the cursor is on
;(colon)/''something'':search for the next occurrence of ''something''
;ZZ:save changes and exit
__NOTE:__ As with everything in UNIX, the commands are case sensitive.
![VI Quick Help|http://www.lagmonster.org/docs/vi.html |target='_blank' ]
![VI Quick Advanced Help|http://www.lagmonster.org/docs/vi2.html |target='_blank' ]