Into to Linux: Chapter 3
The vi editor can function in which two of the following modes? (Choose both that apply.)
Command Insert
How can a user switch from insert mode to command mode when using the vi editor?
ESC key
After typing the ls -F command, you notice a filename that ends with an * (asterisk) character. What does this mean?
It is an executable file
Using wildcard metacharacters, how can you indicate a character that is NOT a or b or c or d?
[!a-d]
cat command
displays the contents of a text file on the screen
If "resume" is the name of a file in the home directory off the root of the filesystem and your present working directory is home, what is the relative name for the file named resume?
resume
grep command
"global regular expression print", searches files for patterns using regular expressions and meta characters.
The less command offers less functionality than the more command. True or False?
False
After typing the ls -a command, you notice that there is a file whose filename begins with a dot ( . ). What does this mean?
It is a hidden file
command mode
One of the two modes in vi; it allows a user to perform any available text editing task that is not related to inserting text into the document.
How can you specify a text pattern that must be at the beginning of a line of text using a regular expression?
Precede the string with a ^
Which command searches for and displays any text contents of a binary file?
Strings
A directory is a type of file. True or False?
True
Which of the following is an absolute pathname? Choose all that apply.
c:\myfolder\resume
The tac command __________
displays the contents of a file in reverse order, last line first and first line last
What will the following wildcard regular expression return: file[a-c]?
filea, fileb, filec
A user types in the command head /poems/mary. What will be displayed on the terminal screen?
first ten files of the file mary
Which command would a user type on the command line to find out which directory in the directory tree he is currently located in?
pwd
What will typing q! at the : prompt in command mode do when using the vi editor?
quit without saving any changes
A user typed in the command pwd and saw the output: /home/jim/sales/pending. How could that user navigate to the /home/jim directory?
cd../..
cd (change directory) command
used to change the current directory
egrep command
used to search files for patterns using extended regular expressions
Linux has only one root directory per directory tree. True or False?
True
meta character
a meta character used to represent a user's home directory.
If a user's current directory is /home/mary/project1, which command could she use to move to the etc directory directly under the root?
cd/etc
A special device file is used to __________.
represent hardware devices such as hard disk drives and ports