Chapter 10 Flashcards
Broadly speaking, text editors fall into one of what two categories
text-mode and GUI
The blank editor is a Unix staple. It’s small and usually installed by default, so you can be fairly certain that it’s present on any Linux computer
vi
Vi uses multiple blank, and you must switch between them to accomplish various tasks
editing modes
The blank editor is a big editor with lots of features, so it’s less likely to be installed by default on small, lightweight distributions
emacs
Several small editors are modeled after emacs but omit many of its advanced features. One of these editors is blank, which is small, lightweight and easy to use.
nano
The blank editor is both a text-mode editor, and a GUI editor
emacs
The GNOME desktop environment has an associated text editor known as blank
gedit
Blank and blank are editors that are associated with the K Desktop Environment (KDE).
KWrite and Kate
The blank editor is not tied to any particular desktop environment, and it’s small and lightweight. It also runs under other OSs than Linux.
Geany
What is the syntax to launch a nano file with a new document
nano filename.txt
Most editing programs have what three basic convention for displaying information
Title Bar
Status Bar
Shortcut List
In addition to control characters, nano uses blank to activate some functions. These key combinations use either the ESC, ALT of META key followed by another key.
metacharacters
What is the nano keystroke for copy?
M-6
What is the nano keystroke for paste?
Ctrl-U
What is the nano keystroke for cut?
Ctrl-K
What is the nano keystroke for go to the next line in the file?
Ctrl-N
What is the nano keystroke for help documentation?
Ctrl-G
What is the nano keystroke to move to the start of the file
M-/
Can you copy multiple lines and paste them all at the same time in nano?
yes
Pressing blank or blank enables you to insert another file into the current one at the cursor’s current position in nano
Ctrl-R or F5
In nano, pressing blank or blank activates a search feature
Ctrl-W or F6
In nano, you can replace one string with another by pressing blank or blank. The program prompts you to enter a search term and the term to take its place.
Ctrl+/ or M-R
In nano, one way to save a file is the CTRL-blank option
Ctrl-O
What nano command allows you to save and exit at the same time?
Ctrl-X
Blank was the first full-screen text editor written for Unix.
vi
A new version of Vi was created and called “vi improved” or blank.
vim
Although the vi editor is useful for editing configuration files, it shines in editing program files such as blank
shell scripts
At any given moment, vi is running one of what three modes
Command mode
Ex mode
Insert mode
In vi, the blank mode accepts commands, which are usually entered as single letters.
Command mode
In vi, to manipulate files, you use blank mode, which you enter by typing a colon (:) followed by the name of the command you want to use.
Ex mode
In vi, you enter text in blank mode
Insert mode
When you first launch vi, you are in blank mode.
command mode
In vi, how do you switch to insert mode
type I
In vi, how is the insert mode indicated on the screen?
the word –INSERT– will be on the bottom of the window
In vi, how do you exit insert mode?
Press ESC
Type blank to enter ex mode in vi, and then type blank to write and quit
:wq
In vi, what keystroke opens a new line immediately below the line where the cursor is and enters insert mode
O
In vi, what command would be used to yank two lines
2yy (without hitting enter)
In vi what command pastes starting on the line after the cursor
p
In vi, what do you type to delete a line
dd
In vi, what do you type to save and exit a file which is equivalent to :wq
ZZ
In vi, you can use the blank key to change case
tilde(~)
In vi, to undo any change, type blank
u
In the vi command mode, typing blank (lowercase) opens text, that is, inserts a new line immediately below the current one and enters insert mode on that line
o
In vi, how do you search for text in a file?
type / in command mode, followed by the term you want to search
In vi, how do you search backwards?
type ?
In vi, the blank command changes text from within the command mode
c
What does cw do in command mode of vi?
changes the next word
What does cc do in command mode of vi?
changes the next line
In vi, the blank key brings you to a line number that you specify
G
In vi, the blank key homes the cursor - that is moves it to the top of the screen
H
In vi, the blank key moves the cursor to the bottom of the screen
L
In vi, to replace all occurrences of one string with another type blank where original is the original string, replacement is the new string, and % should be the starting line number, ending line number for a small range change
:%s/original/replacement/g
To save your vi file without exiting the editor type blank in command mode
:w
In vi, the blank command edits a new file
:e
In vi, the blank command includes the contents of an old file into an existing file, appending it to the existing file
:r
In vi, the ex command blank executes the external command that you specify, for example ls
:!
In vi, use the blank command to quit. like the e command, it won’t exit without saving unless you append the command with blank, which forces quit without saving the modifications
:q
!
For which type of file is nano least likely to be useful for examining or editing?
A. A text file encoded in Unicode
B. A shell script file
C. A text file encoded in ASCII
D. A LibreOffice word document
E. A Linux configuration file
D
What keystrokes invoke the nano search function? (Choose all that apply)
A. F3
B. F6
C. Esc-S
D. Ctrl-F
E. Ctrl-W
B,E
How would you remove two lines of text from a file when using vi?
2dd
True or False: Unicode is useful for encoding most European languages but not languages in Asia
False
True or False: GUI text editors for ASCII are superior to text-mode ASCII editors because GUI editors support underlining, italics, and multiple fonts
False
True or False: if you’ve never used a text editor before, nano is usually the best one to learn first
True
Three keystrokes that can initiate a search-and-replace operation in nano are blank, blank, and blank
Ctrl+/, F4, Esc+R
While in vi’s command mode, you can type blank to undo a change
u
To save a file and exit the vi text editor in command mode, type blank
cw
ASCII supports blank unique characters (not including control characters)
128