Ch.3 Exploring Linux Filesystem

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which of the following key combinations, commonly used in the vi editor command mode, displays current line statistics? a. Ctrl + g b. Alt + s c. Alt + x d. Ctrl + P

a. Ctrl + g

The tac command . a. displays the contents of a file in reverse order, last line first and first line last 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. is not a valid Linux command

a. displays the contents of a file in reverse order, last line first and first line last

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

A user types in the command head /poems/mary. What will be displayed to the terminal screen? a. the first line of the file mary b. the first 10 lines of the file mary c. the header for the file mary d. the first 20 lines of the file mary

b. the first 10 lines of the file mary

Select the command below that can be used to provide a long listing for each file in a directory: a. ls -L b. ls -F c. ls -t d. ls -l

d

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 ^.

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 colon (:) character. d. Press the Esc key.

d. Press the Esc key.

To display a text file in reverse order, what command should be used?​ ​ a. tee b. sed ​c. cat d. tac

d. tac

What command can be used to display the last five lines of a text file? a. head -5 b. stop -5 c. end -5 d. tail -5

d. tail -5

The less command offers less functionality than the more command. True False

False

Which of the following is an absolute pathname? (Choose all that apply.) a. C:\myfolder\resume b. resume c. /home/resume d. C:home/resume

a, b

The vi editor can function in which two of the following modes? (Choose both that apply.) a. command b. input c. interactive d. insert

a, d

Using a regular expression, 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

a. [^abcd]

When issuing the ls -F command, what special character appended to the filename indicates that the file is a shortcut to another file? a. & b. * c. = d. @

d. @

After typing the ls -a command, you notice that there is a file whose filename begins with a period ( . ). 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

Chase is trying to extract records for employees 423 through 428 out of a comma separated values file that starts with the employee number. Which of the following commands would accomplish this? (Choose all that apply.) a. grep 423,424,425,426,427,428 employees.csv b. grep "423-428" employees.csv c. grep "[423-428]" employees.csv d. grep "^42[3-8]" employees.csv

d. grep "^42[3-8]" employees.csv

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

Which of the following information does the stat command display about a file? (Choose all that apply.) a. The time a file was created b. The last time the contents of a file were modified c. The last time a file was accessed d. The file size

All of them

Jo has received a text file which contains multiple instances of his name spelled correctly as well as multiple instances spelled as Joe. Which of the following commands would search a text file for any occurrences of either spelling and display them out to the terminal? (Choose three.) ​​a. grep -E "Joe?" document1.txt b. grep -E "Joe*" document1.txt​​ c. grep "Joe?" document1.txt​​ d. grep "Joe*" document1.txt​​

a, b, d

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

Garrett wants to search through a csv file to find all rows that have either the name John or Bob in them and display them out to the terminal. Which of the following commands could Garrett use to perform this search? a. grep (John|Bob) salesemployees.csv b. egrep (John|Bob) salesemployees.csv c. grep -E "(John|Bob)" salesemployees.csv d. grep -E (John|Bob) salesemployees.csv

c. grep -E "(John|Bob)" salesemployees.csv

If enough unique letters of a directory name have been typed, what key can be pressed to activate the BASH shell's completion feature? a. Ctrl b. Alt c. Esc d. Tab

d. Tab

When using the vi text editor, which of the following keys, when in command mode, will move to the last line in the document? a. G b. P c. L d. W

c. G

A directory is a type of file. True False

True

Linux has only one root directory per directory tree. True False

True

In order to move from the /home/joe/test/data to the /home/joe directory, what command below should be issued? a. cd ../.. b. cd .. c. cd ./.. d. /home/joe

a. cd ../..

Select the regular expression metacharacter that matches 0 or more occurrences of the previous character. a. ^ b. * c. ? d. +

b. *

Abdul wishes to view the contents of a binary data file in his home directory to learn more about what program was used to create it. Which of the following commands would allow Abdul to safely view the contents of this file? a. grep b. cat c. strings d. file

c. strings

Wayne is using the command line and is in his home directory. Which of the following will display a list of all files and their sizes from his home directory? (Choose two.) a. ls -al ~ b. ls -ax c. ls -ax ~ d. ls -al /home/wayne

a, d

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 ./.

c. cd ../..

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 etc c. cd /etc d. cd \etc

c. cd /etc

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


Set pelajaran terkait

Stats Ch. 10: Paired Samples t Test

View Set

CHAPTER 5 - Effects of Long-Term Exposure to Radiation

View Set

PHARM EXAM 4 (*ANTIDIABETICS QUESTIONS)

View Set

Lecture 6: Research & Null Hypothesis

View Set