Upgrade to remove ads
Linux+ 1.5 Text Editors
Get Quizlet's official Linux+ - 1 term, 1 practice question, 1 full practice test
Linux+ Certification Exam
Terms in this set (15)
Vim (vi improved), also referred to as vi, is a utility that creates and modifies text files. It is the standard command-line text editor included with Linux distributions. Vim has the following modes:
Command mode is the initial mode vim uses when started. It has commands that cut and replace text, and it is the mode vi uses to enter the other modes.
Command line mode is the mode that works with the file system. Use it to save files after editing them.
Edit mode is the mode that vim uses to write and edit text in the file. It has two operation modes:
Insert mode adds text between the preceding and subsequent text.
Replace mode overwrites subsequent text.
Use... To... Mode
vi Start vim. Type the command at the shell prompt. N/A
vi filename Start vim and immediately begin working on the named file (either a new, non-existent file or an existing file). Type the vi command at the shell prompt. N/A
s Enter insert mode from command mode Command
Esc key Enter the command mode from the edit mode. Insert/Replace
Delete key Delete text Insert/Replace
Insert key Change between insert and replace mode while in edit mode. Insert/Replace
# (line number) Go to a specific line in the document while in command mode. For example 94, moves the cursor to line 94. Command
dw Cut a whole word and trailing space. Command
de Cut a whole word but omit the trailing space. Command
d$ or D Cut all text following the cursor to the end of the line. Command
dd Cut a line from the text. Command
p Place text in memory into the document. Command
u Undo the last action. Command
o Open a new line above the current line. Command
Ctrl+g Display file name, total number of lines in the file and the cursor position. Command
/term Search forward for all instances of a term. Press n to go to the next term and N to go to the previous term. Command
?term Search backward for all instances of a term. Press n to go to the previous term and N to go to the next term. Command
yy Copy a line of text into memory. Command
a Append text after the cursor Command
A Append text after the current line Command
C Change text from current cursor position to the end of the line. Command
cc Change text of the entire line. Command
ZZ Save current file and exit vim. Command
h Move the cursor one space to the left. Command
j Move the cursor down a line. Command
k Move the cursor up a line. Command
l Move the cursor one space to the right. Command
z Exit without saving Command
: Enter command line mode from command mode Command
w Save the current document. Command line
w filename Name and save the file. Command line
w! filename Overwrite the file Command line
q Exit vim. This produces an error if the text was modified. Command line
q! Exit vim without saving. Command line
wq or exit Save the document and exit vim. Command line
e! Reload the file from the last saved version. This discards all edits and reloads the last saved version of the file into vim. Command line
While in vo command mode, you need to copy an entire line of text. What command should you use? (Tip: Enter the command as if in command mode.)
You made a few changes to the /grub/grub/grub.conf file and now you need to exit out of insert mode, save tge canges, and quit. What should you do? (select two. Each answer is a required part of the solution.)
Which ket conbination should you press in vi to save the file you are working on and quit?
You are editing a text file in vi and need to open a new line above the one you are currently working on. Which key shoud you press to accomplish this?
Which of the following commands will cut an entire line from a file while in vi command line mode?
What are the two methods to exit vi from command mode?
Match the vim mode on the left to the correct definition on the right
Command Mode The Mode that vi uses to write and edit text in the file.
Command line mode. The initial vim mode used when vim is started. It has commands that cut and peplace text, and it is the mode vi uses to enter other modes.
Edit Mode The mode that works with the file system. Use it to save files after editing them.
Command Mode The initial vim mode used when vim is started. It has commands that cut and peplace text, and it is the mode vi uses to enter other modes.
Command line mode The mode that works with the file system. Use it to save files after editing them.
Edit Mode The Mode that vi uses to write and edit text in the file
While in command mode, you copied a whole line of text to memory. You navigated to a different location in the file, and now you need to place the line of text. What command should you use?
Match the command on the left with the description on the right to vavigate while in vi command mode.
h Move the cursor up a line.
j Move the cursor one space to the left.
k Move the cursor one space to the right.
l Move the cursor down a line.
Move the cursor up a line. k
Move the cursor one space to the left. h
Move the cursor one space to the right. l
Move the cursor down a line. j
You have opened the /root/myscript file in vi. While looking at the file, your soda spilled, and you hit several keys on the keyboard trying to pick it back up. There are extra characters everywhere in the file, and you know you can'y fix it. How do you exit vi without saving the changes?
While in command mode, you need to find the term Sam. Which command should you use? (Tip: Enter the command as if in vi command mode.)
You need to create a new text file with the name network.txt in the current directory. Which command starts vi and creates the File?
After opening a file in vi, you want to switch from command mode to command line mode. What key should you use?
A friend sent you a shell script file that is 117 lines long. He says that he wants tou to examine code on lines 82 through 87. What command in command line mode takes tou directly to line 82? (Tip: Enter the command as if in comand line mode.)
THIS SET IS OFTEN IN FOLDERS WITH...
Linux+ 1.1 The shell
Linux+ 1.3 Environment Variables
Linix+ 1.4 Aliases
Linux+ 1.2 Help
YOU MIGHT ALSO LIKE...
LabSim Linux+ 1.5
Word Processing Terminology and Tools
OTHER QUIZLET SETS
CH 17 Trauma-and-Stressor-Related Disorders
Quiz 2 Review Bio-217 (Session 8-11)
Unit 8 Quiz