Module 7 Test Flashcards
Which of the following will take output from a command and append it to the end of a file?
a. <
b. «
c. >
d.»_space;
d.»_space;
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. #
d. #
Which of the following can be used for comparing values within an if statement? (Choose two.)
a. -lt
b. -neq
c. =
d. -grt
a. -lt
c. =
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. .gitignore
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»_space; ~/root.txt
c. grep root /etc/passwd | tee ~/root.txt
d. grep root /etc/passwd | split ~/root.txt
c. grep root /etc/passwd | tee ~/root.txt
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.
c. It will split a file into new equally sized files that are 1/10th of the original file size.
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
b. wc -l data.csv
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
c. carrot dog elephant banana apple