Module 3 Test Flashcards

1
Q

Kate wants to compare two text files to identify what might have been changed from one version to another. Which of the following commands can she use to do this?

a. match document1.txt document2.txt

b. version –compare document1.txt document2.txt

c. compare document1.txt document2.txt

d. diff document1.txt document2.txt

A

d. diff document1.txt document2.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Mike has changed directory into one subdirectory after the next and has lost track of where he’s at in the directory tree. Which of the following commands can he use to tell him the full path to the current subdirectory he is in?

a. cd -	
b. pwd	
c. cwd	
d. ls -dir
A

b. pwd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following commands will not interpret regular expressions, which translates into faster results being returned? (Choose all that apply.)

a. grep
b. grep -F
c. egrep
d. fgrep

A

b. grep -F
d. fgrep

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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 “Joe?” document1.txt
b. grep -E “Joe?” document1.txt
c. grep “Joe” document1.txt
d. grep -E “Joe
” document1.txt

A

b. grep -E “Joe?” document1.txt
c. grep “Joe” document1.txt
d. grep -E “Joe
” document1.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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 -E “(John|Bob)” salesemployees.csv

b. grep (John|Bob) salesemployees.csv

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

d. egrep (John|Bob) salesemployees.csv

A

a. grep -E “(John|Bob)” salesemployees.csv

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Chase is trying to extract records for employees 423 through 428 out of a comma separated values file and store them in another one. Which of the following commands would accomplish this? (Choose all that apply.)

a. cat employees.csv | grep 423,424,425,426,427,428 > employees.csv

b. cat employees.csv | grep “42[3-8]” > employees-newhires.csv

c. grep “42[3-8]” employees.csv > employees-newhires.csv

d. grep “42[3-8]” < employees.csv > employees-newhires.csv

A

b. cat employees.csv | grep “42[3-8]” > employees-newhires.csv

c. grep “42[3-8]” employees.csv > employees-newhires.csv

d. grep “42[3-8]” < employees.csv > employees-newhires.csv

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When using the vi text editor, which of the following keys, when in command mode, will change to insert mode and place the cursor at the end of the current line?

a. i	
b. a	
c. I	
d. A
A

d. A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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. L	
c. P	
d. W
A

a. G

How well did you know this?
1
Not at all
2
3
4
5
Perfectly