vi - text editor - basic commands
Ever since my brother bought me a copy of Red Hat in 1997, I have had a on / off affair with various flavours of Linux. Currently I am using Ubuntu. I am using it as a Server / TV in the front room and as an off site (my garage) backup server for my photos and other important junk.
About a year ago I found the joys of using vi as the editor when editing files in Linux. It's really easy to use and for quick changes to files it is ideal.
Here is a quick guide to ways of doing things in vi:
start vi and open the file named 'filename'.
Go into 'insert/edit' mode
Go from 'insert/edit' mode into 'command' mode (To save / close files)
When in command mode save file (w = write)
When in command mode exit file (q = quit)
When in command mode save file then exit file (w = write then q = quit)
finally
When in command mode exit file without saving(q! = quit discard changes)
There are many other commands but the list above should get you going very fast.
About a year ago I found the joys of using vi as the editor when editing files in Linux. It's really easy to use and for quick changes to files it is ideal.
Here is a quick guide to ways of doing things in vi:
start vi and open the file named 'filename'.
vi filename
Go into 'insert/edit' mode
Press the 'ins' key or 'i'
Go from 'insert/edit' mode into 'command' mode (To save / close files)
Press 'Esc' key
When in command mode save file (w = write)
Press ':' then 'w'
When in command mode exit file (q = quit)
Press ':' then 'q'
When in command mode save file then exit file (w = write then q = quit)
Press ':' then 'wq'
finally
When in command mode exit file without saving(q! = quit discard changes)
Press ':' then 'q!'
There are many other commands but the list above should get you going very fast.
Comments