Module 3 Quiz
The vi editor can function in which two of the following modes? (Choose both that apply.) A. text B. command C. input D. interactive E. insert
B. command E. insert
What will the following wildcard regular expression return: file[a-c]? A. filea-c B. filea, filec C. filea, fileb, filec D. fileabc
C. filea, fileb, filec
The tac command ________. A. is not a valid Linux command B. displays the contents of hidden files C. displays the contents of a file in reverse order last word on the line first and first word on the line last D. displays the contents of a file in reverse order last line first and first line last
D. displays the contents of a file in reverse order last line first and first line last
Which command would a user type on the command line to find out the current directory in the directory tree? A. pd B. cd C. where D. pwd
D. pwd
What will typing q! at the : prompt in command mode do when using the vi editor? A. quit as no changes were made B. quit after saving any changes C. nothing because the ! is a metacharacter D. quit without saving any changes
D. quit without saving any changes
After typing the ls -F command, you notice a filename that ends with an * (asterisk) character. What does this mean? A. It is a hidden file B. It is a linked file C. It is a special device file D. It is an executable file
D. It is an executable file
How can you specify a text pattern that must be at the beginning of a line of text using a regular expression? A. Precede the string with a /. B. Follow the string with a \. C. Precede the string with a $. D. Precede the string with a ^
D. Precede the string with a ^
A directory is a type of file. True or False?
True
The less command offers less functionality than the more command. True or False?
False
Linux has only one root directory per directory tree. True or False?
True
Using a wildcard metacharacters, how can you indicate a character that is not an a or b or c or d? A. [^abcd] B. not [a-d] C. [!a-d] D. !a-d
C. [!a-d]
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? A. /home/resume B. /resume C. resume D. \home\resume
C. resume
Which of the following is an absolute pathname? (Choose all that apply.) A. Home/resume B. C:\myfolder\resume C. resume D. /home/resume E. C:home/resume
D. /home/resume
A user types the command head /poems /mary. What will be displayed on the terminal screen? A. the first line of the file mary B. The header for the file mary C. the first 20 lines of the file mary D. the last 10 lines of the file mary E. the first 10 lines of the file mary
E. the first 10 lines of the file mary
A special device file is used to ________. A. enable proprietary custom-built devices to work with Linux B. Represent hardware devices such as hard disk drives and ports C. Keep a list of device settings specific to each individual user D. Do nothing in Linux
B. represent hardware devices such as hard disk drives and ports
Which command searches for and displays any text contents of a binary file? A. text B. strings C. od D. less
B. strings
After typing the ls -a command, you notice a file whose filename begins with a dot (.). What does this mean? A. It is a binary file B. It is a system file C. It is a file in the current directory D. It is a hidden file
D. It is a hidden file
How can a user switch from insert mode to command mode when using the vi editor? A. Press the Ctrl+Alt+Del keys simultaneously B. Press the Del key C. Type a: character D. Press the esc key
D. Press the esc key
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? A. cd .. B. cd /home/mary/etc C. cd etc D. cd /etc E. cd \etc
D. cd /etc
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? A. cd .. B. cd /jim C. cd ../.. D. cd ./.
cd ../..