Module 7 Test Flashcards

1
Q

Which of the following will take output from a command and append it to the end of a file?
a. <
b. «
c. >
d.&raquo_space;

A

d.&raquo_space;

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

Which of the following characters can be entered at the beginning of a line in a shell script to ensure that line is recognized as a comment rather than try to execute it?
a. $
b. >
c. %
d. #

A

d. #

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

Which of the following can be used for comparing values within an if statement? (Choose two.)
a. -lt
b. -neq
c. =
d. -grt

A

a. -lt
c. =

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

Which of the following files can you add filenames to so that the git add * command will not stage them?
a. .gitignore
b. .gitnopush
c. .ignore
d. .nopush

A

a. .gitignore

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

Which of the following will look at the /etc/passwd file for any lines containing the word root and display them out to the screen while simultaneously writing the results to a file? (Choose two.)

a. cat /etc/passwd | grep root | merge ~/root.txt

b. cat /etc/passwd | grep root&raquo_space; ~/root.txt

c. grep root /etc/passwd | tee ~/root.txt

d. grep root /etc/passwd | split ~/root.txt

A

c. grep root /etc/passwd | tee ~/root.txt

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

Which of the following will the split command do on a file when no other options are specified?

a. It will split a file into new files that are 1 kilobyte each.

b. It will split a file into new files that are 1 megabyte each.

c. It will split a file into new equally sized files that are 1/10th of the original file size.

d. It will split a file into new files that are 1,000 lines each.

A

c. It will split a file into new equally sized files that are 1/10th of the original file size.

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

Which of the following commands will count the number of lines in a file named data.csv?
a. lc data.csv
b. wc -l data.csv
c. lines data.csv
d. count -l data.csv

A

b. wc -l data.csv

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

Which of the following results would be created by the command sequence:

echo ‘apple banana carrot dog elephant’ | while read a b c; do echo result: $c $b $a; done

a. elephant dog carrot

b. apple banana carrot dog elephant

c. carrot dog elephant banana apple

d. carrot dog elephant apple banana

A

c. carrot dog elephant banana apple

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