1. What does the c$ command do from command mode?

c$ will begin from the character under the curser till the
end of line. so when you use this command it will show you $
sign at the end of the line and you can change till that point.

2. How to append a file to current file?

to append file1 to file2. first open file1 in vi editor
using vi file1 command. then to append file1 to file 2 just
use the following command.

:w>>file2 so file 1 will be appended to file 2

4. What is the difference between lettered buffer and temporary buffer?

Temporary Buffer

Deleted or copied text goes into a temporary unnamed
buffer. The contents of the temporary buffer may be
retrieved by using the p or P commands.

Lettered Buffers

There are 26 lettered buffers (a-z). Contents of a lettered
buffer are saved until you copy or delete more characters
into it, or until you quit your current vi session.

eg.
From Command Mode

"ayy Copy (yank) a line into buffer letter "a"
"ap Put contents of lettered buffer a below the
current line

5. What are the two different modes in vi editor?

Command Mode
Insert Mode
LastLine mode

6. What are the different delete commands used in vi editor?

dd -- for delete line
x - single character deletion
dw - delete word

7. What are the different commands used to quit from the vi editor?

q! IS THE COMMAND TO QUIT FROM vi EDITOR WITHOUT SAVING
wq IS THE COMMAND TO QUIT FROM vi EDITOR WITH SAVING
q IS THE IS THE COMMAND TO QUIT FROM vi EDITOR IF YOU DONT
EDIT ANYTHING AFTER OPENING THAT FILE

9. What does the /text command do?

/text: it will search for the string(pattern).You will get
the first occurance after pressing enter.If you wanna see
the next occurance then press "n"

10. Which command is used to replace many characters?

change command can be used to change a word/line.

cw change word forward
cb change word backward
c$ change from cursor to end of line
cL change from current line to and of screen
cG change from current line to and of file

or if you want to replace all occurence of some specific
character

:%s/oldText/newText/g

Download Interview PDF