Linux Questions & Answers on vi Editor for Freshers

1. Which one of the following statement is not true?

a) vim editor is the improved version of vi editor
b) vi editor commands are not case sensitive
c) vi editor has two modes of operation: command mode and insert mode
d) vi stands for visual editor
Answer: b
2. Which command is used to close the vi editor?

a) q
b) wq
c) both q and wq
d) none of the mentioned
Answer: c

Explanation: The command ‘q’ just closes the file and ‘wq’ saves and closes the file.
3. In vi editor, the key combination CTRL+f

a) moves screen down one page
b) moves screen up one page
c) moves screen up one line
d) moves screen down one line
Answer: a
4. Which vi editor command copies the current line of the file?

a) yy
b) yw
c) yc
d) none of the mentioned
Answer: a

Explanation: The command ‘p’ puts the copied text after the cursor.
5. Which command is used to delete the character before the cursor location in vi editor?

a) X
b) x
c) D
d) d
Answer: a

Explanation: The command ‘x’ is used to delete the character under the cursor locarion.
6. Which one of the following statement is true?

a) autoindentation is not possible in vi editor
b) autoindentation can be set using the command ‘:set ai’
c) autoindentation can be set using the command ‘:set noai’
d) autoindentation is set by default in vi editor
Answer: b
7. Which command searches the string in file opened in vi editor?

a) / or ?
b) f or F
c) t or T
d) none of the mentioned
Answer: a

Explanation: The command ‘/’ searches downward in the file and command ‘?’ searches upward in the file.
8. In vi editor, which command reads the content of another file?

a) read
b) r
c) ex
d) none of the mentioned
Answer: c
9. Which command shows all the abbreviations in vi editor?

a) ab
b) abb
c) show
d) none of the mentioned
Answer: a
10. Which command sets the number for all lines?

a) :set li
b) :set ln
c) :set nu
d) :set nl
Answer: c

Related

C# Questions & Answers on Searching and Modifying Strings for Freshers

1. Which of these methods of class String is used to separate a substring from a String object? a) substring()b) Substring()c) SubString()d) None of the mentioned Answer: b 2. What will be the ou...

C# Questions & Answers on Comparison of Strings for Freshers

1. Which of these methods of class String is used to compare two String objects for their equality? a) equals()b) Equals()c) isequal()d) Isequal() Answer: a 2. Which of these methods is used to c...

C# Questions & Answers on String Class with Description for Freshers

1. What is the String in C# meant for? a) Variableb) Character Arrayc) Objectd) Class Answer: c Explanation: C# Supports a predefined reference type known as string.When we declare a string using...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item