Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Using The Vi Editor
Pronco
post Jul 8 2004, 07:58 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 12
Joined: 1-July 04
From: Somewhere Near
Member No.: 3,268



Linux Administrators are constantly changing the configuration files of their system services and applications to enable new services or to make them run more efficiently. All configuration files in Unix are simple text files, but in order to edit them, you need a text editor. A wide variety of editors are available for Linux and Unix. Some of the most popular editors include Emacs and Pico. Although each person has his or her own favorite editor, only the vi editor comes by default with every version of Unix

The vi editor is certainly not the easiest and most user-friendly text editor, but because of its wide availability and existence on most Unix systems, it is extermely important that every Linux System Administrators know how to use it

The vi editor operates in two basic modes:

1- Command mode
2- Insert mode

when vi is started, it is in command mode. This mode allows you to enter commands to edit files or navigate your text file. However, you can only add or insert text by using the insert mode. from command mode, you can enter insert mode by typing the letter i. To return to command mode, use the Escape key

Editing text files:

* To start the vi program, type the following at the command prompt

CODE
vi filename


The filename can be a new or existing file. Remember that when you first start vi, you are initially in command mode. if you are working on a new file, you can immediately type the letter i to enter into insert mode and start adding text

If you are working on an existing file, you can use the cursor keys, or the h,j,k,l keys to navigate to where you want to begin.

You can use the CTRL-f or CTRL-b to move ahead or back a page

To insert text at an exact point, you can type the letter i for insert and start adding your text, Other options include the letter a, Which adds text next to the cursor location, and the letter o, which starts your text on the next line below the current one.

if you make a mistake while typing, you can use the backspace key to delete characters. if you want to delete characters in command mode, hit the Escape key, and then use the letter x to delete characters one at a time. If you want to delete an entire line, use the dd command. The command dw deletes only the entire word that your cursor is currently on

To save your file, hit the Escape key to enter command mode, and then type :w . To save and exit out the vi editor, use the :wq command. Or you can use an equivalent to the :wq command and type the letters ZZ in command mode to save and exit the file

If you want to exit without saving your file, use the :q command. This command asks you if you want to save the file before quitting. If you want to bypass the prompt, use the :q! command


--------------------
-I'm a code junkie security enthusiast

-http://pronco.manalaa.net
Go to the top of the page
 
+Quote Post

Posts in this topic
- Pronco   Using The Vi Editor   Jul 8 2004, 07:58 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd November 2017 - 01:45 PM