How Edit File Using Three Editors In Linux Redhat
Edit File Using Three Editor Of Linux Redhat
In This Post You'll Learn Edit Files by 3 Editors. Linux have 4 Editors with Different User Interface. You can Edit file Using there Editors.
We Have 3 Editors.
- Vi - Editor
- Vim -Editor
- gedit -Editor
Vi Editor.
One edits a file in vi by issuing the command: vi file-to-edit.txt
The vi editor has three modes, command mode, insert mode and command line mode.
- Command mode: letters or sequence of letters interactively command vi. Commands are case sensitive. The ESC key can end a command.
- Insert mode: Text is inserted. The ESC key ends insert mode and returns you to command mode. One can enter insert mode with the "i" (insert), "a" (insert after), "A" (insert at end of line), "o" (open new line after current line) or "O" (Open line above current line) commands.
- Command line mode: One enters this mode by typing ":" which puts the command line entry at the foot of the screen.
Partial list of interactive commands:
| Keyword | Action |
|---|---|
| i | Insert at cursor. Puts you in insert mode. Must use esc key to terminate insert mode. |
| I | Insert before the cursor. Puts you in insert mode. Must use esc key to terminate insert mode. |
| a | Append after cursor. Puts you in insert mode. Must use esc key to terminate insert mode. |
| A | Append at end of line. Puts you in insert mode. Must use esc key to terminate insert mode. |
| o | Open a new line below the current cursor position. Also puts you in insert mode. Must use esc key to terminate insert mode. |
| O | Open a new line above the current line. Also puts you in insert mode. Must use esc key to terminate insert mode. |
| ESC | Terminate insert mode. Terminates most other modes as well. |
| u | Undo last change |
| U | Undo all changes to entire line |
| dd 3dd | Delete line (stored in local buffer) Delete 3 lines (stored in local buffer). |
| D | Delete contents of line after cursor |
| C | Delete contents of line after cursor and insert new text. Press esc key to end insertion. |
| dw 4dw d) d$ d- dfx d'x 'ad'b d/cat | Delete word Delete 4 words Delete to end of sentence Delete all characters from cursor to end of line Delete current and previous line Delete from cursor to first occurance of the letter "x" Delete from the current line to the line marked with the identifier "x" Delete from the line of mark "a" to the line marked "b". Delete all characters from the cursor to the next occurance of (but not including) "cat" |
| cw c) c$ | Change word Change sentence Change from cursor to end of line (See "d" delete above for other variations) |
| x | Delete character at cursor |
| X | Delete character before cursor |
| Y or yy | Yank (copy) current line into "unnamed" storage buffer. |
| p | Paste unnamed storage buffer after current line. |
| P | Paste unnamed storage buffer before current line. |
| r | Replace character |
| R | Overwrite characters from cursor onward |
| s | Substitute one character under cursor continue to insert |
| S | Substitute entire line and begin to insert at beginning of line |
| J | Join current and following line into one line |
| ~ | Change case of individual character |
| ctrl-a ctrl-x | Increment number under the cursor. Decrement number under the cursor. |
| . | repeat last command action. |
Control Characters: Note that to enter control
characters while in insert mode, prefix the the control character with
"ctrl-v" and then type the control character (ex. Carriage control:
ctrl-M, Form feed: ctrl-L, Backspace: ctrl-H, Delete: ctrl-P, ...). Each
control character must first be proceeded by ctrl-v while in insert mode.
Vim Editor
This "vi" tutorial is intended for those who wish to master and advance their skills beyond the basic features of the basic editor. It covers buffers, "vi" command line instructions, interfacing with UNIX commands, and ctags. The vim editor is an enhanced version of vi. The improvements are clearly noticed in the handling of tags.
The advantage of learning vi and learning it well is that one will find vi on all Unix based systems and it does not consume an inordinate amount of system resources. Vi works great over slow network ppp modem connections and on systems of limited resources. One can completely utilize vi without departing a single finger from the keyboard.
| Keyword | Action |
|---|---|
| i | Insert at cursor. Puts you in insert mode. Must use esc key to terminate insert mode. |
| I | Insert before the cursor. Puts you in insert mode. Must use esc key to terminate insert mode. |
| a | Append after cursor. Puts you in insert mode. Must use esc key to terminate insert mode. |
| A | Append at end of line. Puts you in insert mode. Must use esc key to terminate insert mode. |
| o | Open a new line below the current cursor position. Also puts you in insert mode. Must use esc key to terminate insert mode. |
| O | Open a new line above the current line. Also puts you in insert mode. Must use esc key to terminate insert mode. |
| ESC | Terminate insert mode. Terminates most other modes as well. |
| u | Undo last change |
| U | Undo all changes to entire line |
| dd 3dd | Delete line (stored in local buffer) Delete 3 lines (stored in local buffer). |
| D | Delete contents of line after cursor |
| C | Delete contents of line after cursor and insert new text. Press esc key to end insertion. |
| dw 4dw d) d$ d- dfx d'x 'ad'b d/cat | Delete word Delete 4 words Delete to end of sentence Delete all characters from cursor to end of line Delete current and previous line Delete from cursor to first occurance of the letter "x" Delete from the current line to the line marked with the identifier "x" Delete from the line of mark "a" to the line marked "b". Delete all characters from the cursor to the next occurance of (but not including) "cat" |
| cw c) c$ | Change word Change sentence Change from cursor to end of line (See "d" delete above for other variations) |
| x | Delete character at cursor |
| X | Delete character before cursor |
| Y or yy | Yank (copy) current line into "unnamed" storage buffer. |
| p | Paste unnamed storage buffer after current line. |
| P | Paste unnamed storage buffer before current line. |
| r | Replace character |
| R | Overwrite characters from cursor onward |
| s | Substitute one character under cursor continue to insert |
| S | Substitute entire line and begin to insert at beginning of line |
| J | Join current and following line into one line |
| ~ | Change case of individual character |
| ctrl-a ctrl-x | Increment number under the cursor. Decrement number under the cursor. |
| . | repeat last command action. |
Gedit Editor
: This is one of the cutest text editor in the Linux world. It is fairly small in size, but has fairly decent text and code editing capabilities. Although it is part of the GNOME desktop enironment you can use it on most any systems, including Windows and OS X. It is a full screen, graphical text editor. It is not as powerful as vi, but, for writing small pieces of code, this is not a bad choice. In fact, I always install it on all of my systems and use it for writing small pieces of code.
Easily Editable Like Windows Note Pad.
How To Use There Command Watch Full This Videos.

Leave a Comment