Upload
varnnit-jain
View
98
Download
1
Embed Size (px)
Citation preview
By : Varnnit Jain9990888972
Text Editor In Red Hat Enterprise Linux
Text EditorsAs the name suggest, text editors are files
or programs that are used for editing the plain text files.
In Windows such programs are known as “notepads” software.
Text editors are provided with the operating system and software development packafes, and can be used to change the configyration files, documentation files and programming languagres source code.
In linux there are basically two main types of text editors : vi (visual) and vim (visual Improved).
Vi (Visual) EditorPronounced as vee-eye.It provides basic text editing capabilities.There are two mode in Vi : Insert mode and
Command Mode.It begins with command mode. We can switch to the
insert mode by pressing i.i is used to open the insert mode whereas esp can
be used to switch back to the command mode.We can type whatever e want in the insert mode.iq! is used to exit without saving the textiwq! Is used to save and exit.iw! Is used to save the file.
Vim (Visual Improved) EditorIt is the newer version of the vi text editor.Vim is especially designed for the Linux
Operating system not for Unix.In vim we can open multiple files on to the
same screen having different buffers.
Commands for vi and vimi : For insert mode.Esc : For command mode.iw : To save the file after exiting insert mode.iq : Exit without save.iwq : Save and exit.iq! : Forcefully exit.iwq! : Forcefully save and exit.yy : copy (vi mode).dd : deleting or cutting a particular line.p : Paste
Commands for vi and vim (cont.)yy : Copy 1 line.4yy : Copy 4 lines.dd : Delete 1 line.4dd : Delete 4 lines.yw : Copy 1 word.Shift + g : Go to the end of the page.u : UndoCtrl + r : Redo
NOTE : All these commands are given in thee command mode.
Managing files from the command lineCreate a file and add some characters to it.#head <filename> : To show top 10
lines.#head –n 5 <filename> : To show top 5
lines.#tail <filename> : To show
bottom 10 lines.#tail –n 5 <filename> : To show
bottom 5 lines.FOR EXAMPLE : Lets create a file and name it
as testing.
This is the Insert Mode.
Use The Command :iq in the command mode to exit the file without saving it.
Use The Command :iwq in the command mode to exit the file after saving it.
Use The Command #head <file name> in the terminal to show the top 10 lines of the file.
Use The Command #tail <file name> in the terminal to show the top 10 lines of the file.
Use The Command #tail <file name> in the terminal to show the top 10 lines of the file.