Explain Any Two Text Editors in Detail

Vi

The visual editor on the Unix.

  • a very powerful
There are two modes in vi
  • Command mode
  • Input mode
Editing Commands (Within Command Mode)

Error Correction

  • CTRL-h Delete a letter
  • CTRL-w Delete a word
  • CTRL-
    • u Delete a line
    • d Deletes current character
    • dw Deletes to the end of the word
    • dd Deletes the current line
    • u Undo. “Undoes” the last operation that user performed
To exit from vi
  • :q <enter> is to exit, if you have not made any changes to the file
  • :q! <enter> is the forced quit, it will discard the changes and quit
  • :wq <enter> is for save and Exit
  • :x <enter> is same as above command
  •  ZZ is for save and Exit
  • The ! Character forces over writes, etc. :wq!
The standard keys for moving cursor are:
  • h - for left
  • l - for right
  • j - for down
  • k - for up
  • w - to move one word forward
  • b - to move one word backward
  • $ - takes you to the end of line
  • <enter> takes the cursor the the beginning of next line
The standard keys for moving cursor are:
  • h - for left
  • l - for right
  • j - for down
  • k - for up
  • w - to move one word forward
  • b - to move one word backward
  • $ - takes you to the end of line
  • <enter> takes the cursor the the beginning of next line
  • Control-d scrolls the screen down (half screen)
  • Control-u scrolls the screen up (half screen)
  • Control-f scrolls the screen forward (full screen)
  • Control-b scrolls the screen backward (full screen).
Copy, cut and paste in vi
  • yy - (yank) copy current line to buffer
  • nyy - Where n is number of lines
  • p - Paste the yanked lines from buffer to the line below
PICO
  • Pico is an easy-to-use editor that resembles Pine.
  • simplified version of emacs.
  • Although it lacks most of emacs' sophisticated functions.
  • Unlike emacs, pico is a shell or terminal-based editor only.
    • There are no added benefits of running pico under X window.
    • There is no toolbar, but pico always displays a list of commands at the bottom of the screen.
  • - Pico does not have as extensive of a tutorial as EMACS, but it does offer a built in help screen. To access it type ctrl-g.
Commands In PICO
  • ^G - Display help.
  • ^X - Exit pico, saving buffer.
  • ^O - Saves the current buffer to a file.
  • ^^ - Mark cursor position as beginning of selected text.
  • ^K - Cut selected text. Note: The selected text's boundary on the cursor side ends at the left edge of the cursor.
  • ^U - Paste last cut text at the current position.
  • ^W - Search for text.
  • ^T - Invoke the spelling checker.
  • ^L - Refresh the display.
  • ^J - Format (justify) the current paragraph.
  • ^V - Move forward a page of text.
  • ^Y - Move backward a page of text.
  • ^F - Move forward a character.
  • ^B - Move backward a character.
  • ^P - Move to the previous line.
  • ^N - Move to the next line.
  • ^A - Move to the beginning of the current line.
  • ^E - Move to the end of the current line.
  • ^C - Report current cursor position.
  • ^D - Delete the character at the cursor.
  • ^I - Insert a tab at the cursor.
  • ^R - Insert an external file at the cursor.
Create the file Hello
  • pico hello.pl
Run it!
  • ./hello.pl

Unix Tips

See Also
MCQ Questions with Answers #1
MCQ Questions with Answers #2

Have a Unix Problem
Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.