Visual Editor:
Popular text editors for Linux configuration files include emacs, pico, joe and vi.
While emacs may be the most popular text editor in the world of Linux, every administrator needs at least a basic knowledge of vi. While emacs may be more popular and flexible, vi may help you save a broken system. If you ever have to restore a critical configuration file using an emergency boot floppy, vi is probably the only editor that you will have available.
In reality, RHEL 3 uses enhanced version of vi editor know as vim. It adds color to different types of variables in key configuration files such as /etc/fstab. All regular vi command work in vim editor. While you can remove coloring in vim editor with :nohl command, this detail does not effect your ability to manage your Linus System.
You need to know how to restore the system from rescue floppy, which does not have enough room to carry any editor other than vi.
Basic Modes of vi editor:
1) Command mode
2) Insert mode
1) Command mode: When you use vi to open a file, it opens in command mode.
Opening is file is easy : vi filename command, by default it starts in command mode.
Example : vi /etc/passwd file shown in figure :
1) Insert mode: After open the file /etc/passwd with vi press i for insert mode
vi /etc/passwd ------------> then press i or o, o is opens new line bellow the current position of cursor,now vi in insert mode in insert mode you can add or edit the file then follow then commands for vi command mode:
1) :wq save the file and quit
2) :q exit file without saving
3) :q! if you want to abandon any changes that you have made
Press Esc to Normal mode then
4) x to delete current highlighted charector
5) dd to delete current highlighted line
6) dw to delete current highlighted word
7) / to forward search and ? to backward search
Popular text editors for Linux configuration files include emacs, pico, joe and vi.
While emacs may be the most popular text editor in the world of Linux, every administrator needs at least a basic knowledge of vi. While emacs may be more popular and flexible, vi may help you save a broken system. If you ever have to restore a critical configuration file using an emergency boot floppy, vi is probably the only editor that you will have available.
In reality, RHEL 3 uses enhanced version of vi editor know as vim. It adds color to different types of variables in key configuration files such as /etc/fstab. All regular vi command work in vim editor. While you can remove coloring in vim editor with :nohl command, this detail does not effect your ability to manage your Linus System.
You need to know how to restore the system from rescue floppy, which does not have enough room to carry any editor other than vi.
Basic Modes of vi editor:
1) Command mode
2) Insert mode
1) Command mode: When you use vi to open a file, it opens in command mode.
Opening is file is easy : vi filename command, by default it starts in command mode.
Example : vi /etc/passwd file shown in figure :
vi /etc/passwd ------------> then press i or o, o is opens new line bellow the current position of cursor,now vi in insert mode in insert mode you can add or edit the file then follow then commands for vi command mode:
1) :wq save the file and quit
2) :q exit file without saving
3) :q! if you want to abandon any changes that you have made
Press Esc to Normal mode then
4) x to delete current highlighted charector
5) dd to delete current highlighted line
6) dw to delete current highlighted word
7) / to forward search and ? to backward search