Practice Test #1 Questions Important Instructions 1. Read all the instructions and both sides of all pages. 2. Manage your time when answering questions on this test. Answer the questions you know, first. ________________________________________________________________________________ Multiple Choice - 121 Questions This is a practice test containing many practice questions. The real test will contain some questions similar to these. There are probably many more questions in this practice test than there will be time for in the real test. The real test will have approximately one question per minute. The real test may have some questions unlike anything given here. Knowing the concepts behind the questions is necessary; memorizing these specific answers won't help. 1. If file /a contains thirty lines, and file /b contains fifty lines, then how many lines are output by this command: cat /a | sort /b a. 20 b. 50 c. 30 d. no lines (empty file) e. 80 2. Which of these command sequences will make file3 contain all of the content of file1 followed by all of the content of file2? a. cp file1 >file3 file2 >file3 b. cp file1 file2 >file3 c. mv file1 file2 >file3 d. echo file1 file2 >file3 e. cat file1 file2 >file3 3. How many command arguments does the shell pass to this echo command: echo 'It's a bird! It's a plane!' a. Three arguments. b. Five arguments. c. Four arguments. d. One argument. e. Two arguments. 4. If my current working directory is /home, and my home directory is /home/me, which of the of the following commands copies the Unix password file into my home directory under the name foo? a. cp ../etc/passwd ../me/foo b. cp ../../etc/passwd /me/foo c. cp me/../../etc/passwd me/foo d. cp ../home/me/../etc/passwd ./me/./foo e. cp ./me/../etc/passwd ../home/me/foo 5. What is the output on your screen of this command sequence: echo dog >one ; echo cow | head -2 one a. dog b. cow followed by dog c. an error message d. cow e. dog followed by cow 6. If you type the command sleep 60 which of the following key sequences will interrupt it and take you immediately back to the command prompt? a. [CTRL-L] b. [CTRL-D] c. [CTRL-U] d. [CTRL-R] e. [CTRL-C] 7. In an empty directory, what is the shell output of these three commands: touch xx .x xy .y xz ; a='x* y*' ; echo "$a" a. *x *y b. x* y* c. xx xy xz y* d. xx xy e. $a 8. What appears on your screen after this bash shell command line? echo hi >a ; cat a | wc -c a. 1 b. no output c. 3 d. 4 e. 2 9. What is the output of this shell command line in an empty directory? ls * a. * b. . .. c. no output d. an error message from ls saying * does not exist e. . 10. If file /a contains 40 lines, and file /b contains 60 lines, then how many lines are output by this command: sort /a /b | cat /a | cat /b a. 60 b. 40 c. 100 d. 160 e. 200 11. If I am in my home directory named /home/me and x is an empty sub- directory, what is true after this command line: touch ./x/fil ; mv x/./fil x/../../me/./y a. the directory x is still empty b. the directory x now contains only a file named y c. there is a second copy of the file fil in the file named y d. the command fails because the path x/./fil does not exist e. the command fails because the path x/../../me does not exist 12. How many lines are in file out after this bash shell command line? echo hi >dog >cat >out a. no such file (file does not exist) b. 1 c. no output (empty file) d. 2 e. 3 13. What appears on your screen after this bash shell command line? echo hi >a ; ls a | wc -c a. 4 b. 2 c. no output d. 1 e. 3 14. Given an existing file of yours named /a/x, what is the output of this sequence of three shell commands: echo hi >/a/x ; sort /a/x >/a/x ; wc /a/x a. 2 2 4 /a/x b. 0 0 0 /a/x c. 1 1 2 /a/x d. no output e. 1 1 3 /a/x 15. If /etc/passwd is a file name, which of the following pathnames always leads to the same file? a. /./../etc/./passwd b. /etc/passwd/./. c. /etc/passwd/../.. d. /etc/../../passwd e. ././etc/passwd 16. How many arguments are passed to the command by the shell on this command line: bar bar bar a. 6 b. 4 c. 7 d. 5 e. 3 17. If I am in my home directory named /home/alleni and empty is an empty sub- directory, what is true after this command line: date >./cat ; mv empty/../cat ../alleni/dog a. there is a second copy of the file cat in the file named dog b. the command fails because the path ../alleni/dog does not exist c. the directory empty now contains only a file named dog d. the directory empty/.. now has a file named dog in it e. the command fails because the path empty/../cat does not exist 18. What is in file out after running this bash shell command line? echo 2 3 >out 3 0 a. 2 3 0 b. 2 3 3 0 c. 2 3 >out 3 0 d. no output (empty file) e. 2 3 19. What is the output of this successful command sequence? cd /home/foo ; touch dir ; mkdir bar ; pwd a. /home/foo/dir/bar b. /home/foo/dir c. /home/foo d. /home/foo/bar e. /bar 20. Which of the following is true, given this long directory listing from ls: drwxr-x--x 256 ian user 512 May 30 12:35 dir a. The number 256 is the octal permissions of this directory. b. The number 256 is the inode number of this directory. c. The number 256 is the size of this directory. d. The number 512 is the size of this directory. e. The number 512 is the count of links (names) this directory has. 21. In an empty directory, what is the shell output of these three commands: touch .1 .2 .3 11 12 ; b='.1* .2*' ; echo '$b' a. '.1* .2*' b. .1* .2* c. .1 .2 d. 11 .1 12 .2 e. $b 22. What is in the file out after this command sequence: echo hi >x ; echo ho >>x ; cp x y >out a. hi followed by ho b. hi c. nothing - empty file - no data d. no such file (nonexistent) e. ho 23. Which of the following statements is true about this shell command line: >/a/b/c cat /a/b/d a. The command cat sees only one argument. b. The command cat sees two arguments. c. The command /a/b/c sees only one argument d. The command is always invalid. e. The command /a/b/c sees two arguments. 24. If I am in my home directory named /home/myhome and sub is an empty sub- directory, what is true after this command line: touch ./fil ; mv sub/../fil ../myhome/cat a. the command fails because the path sub/../fil does not exist b. the command fails because the path ../myhome/cat does not exist c. there is a second copy of the file fil in the file named cat d. the directory sub now contains only a file named cat e. the directory sub/.. now has a file named cat in it 25. If file /a/b contains ninety-nine lines, each of which is the two-digit line number of the line in the file (01 through 99), what is the output of this command: sort /a/b /a/b | tail -4 | head -1 a. 04 04 b. 96 c. 96 96 d. 98 e. 01 01 26. How many lines are in file out after this bash shell command line? echo hi >dog >out >cat a. 2 b. no such file (file does not exist) c. no output (empty file) d. 3 e. 1 27. Given an existing file of yours named /a/b/x, what is the output of this sequence of three shell commands: echo hi >/a/b/x ; wc /a/b/x >/a/b/x ; cat /a/b/x a. 1 1 2 /a/b/x b. 1 1 3 /a/b/x c. 0 0 0 /a/b/x d. 1 1 1 /a/b/x e. no output 28. What appears on your screen after this bash shell command line? echo hi >a ; cp a b | wc -c a. 3 b. 0 c. no output d. 1 e. 2 29. How many lines are in the file out after this command sequence: echo hi >x ; echo ho >>x ; cat x x x >out a. 6 b. 2 c. 1 d. 3 e. nothing - empty file - no data 30. Which command below removes only this five-character file name containing a special character (and no others): *test a. rm \\*test b. rm ''*test'' c. rm ./\\*test d. rm "*test" e. rm ./*test 31. If you type the command sort which of the following key sequences will send an EOF and take you immediately back to the command prompt? a. [CTRL-D] b. [CTRL-C] c. [CTRL-L] d. [CTRL-U] e. [CTRL-R] 32. In an empty directory, how many words are in file cow after this bash shell command line? touch dog dog cat ; ls >cow a. 4 b. 2 c. no output (empty file) d. 1 e. 3 33. If file ten contains ten lines, and file twenty contains twenty lines, then how many lines are output by this command: cat twenty | sort ten a. no lines (no output) b. 20 c. 10 d. 60 e. 30 34. What is in the file bar after this command sequence: echo hi >x ; echo ho >x ; mv x y >bar a. ho b. hi c. hi followed by ho d. nothing - empty file - no data e. no such file (nonexistent) 35. What can you do to get back (redo) the last command you typed to the bash (Linux) shell? a. Type [CONTROL]-[BACKSPACE] b. Type [CONTROL]-[ALT]-[UP] c. Use the "PageUp" key. d. Type [ALT]-[F2] e. Use the "UpArrow" key. 36. What is the output of this shell command line in an empty directory? echo * a. * b. . c. no output d. . .. e. .. 37. Which Unix command sequence deletes a directory and everything inside it? a. deltree -all dir b. rm -r dir c. erase -r dir d. rmdir -all dir e. erase dir 38. In an empty directory, what is the length of the longest file name created by the following two-command sequence: var='a ab abc abcd abcde' ; touch $var a. 15 characters b. 19 characters c. 3 characters d. 5 characters e. 4 characters 39. In an empty directory, how many arguments are passed to the rm command in this bash command line? date >a1 ; touch a2 ba ca >all ; rm a* a. 2 b. 3 c. 4 d. none e. 1 40. If your PATH variable contains /bin:/usr/bin, what is the output of this bash shell command line? echo '$PATH' a. /bin:/usr/bin b. $PATH c. '$PATH' d. /bin e. '/bin' 41. Which of the following statements is true about this shell command line: >bar zoom bar haven a. The command bar sees only two arguments b. The command zoom sees three arguments. c. Error: The command name is missing from the command line. d. The command bar sees three arguments. e. The command zoom sees two arguments. 42. In an empty directory, how many words are in file out after this bash shell command line? touch a ; ls >out a. 3 b. no output (empty file) c. 4 d. 2 e. 1 43. Which command line below does not show any lines from inside the file dog? a. more dog b. tail dog c. head dog d. ls dog e. less dog 44. What is the output of this sequence of three shell commands: echo hi >wc ; ls wc >wc ; wc wc a. no output b. 2 2 4 wc c. 1 1 2 wc d. 1 1 3 wc e. 0 0 0 wc 45. What appears on your screen after this bash shell command line? echo xx >z ; ls z > wc a. 1 1 3 b. no output c. 2 d. 3 e. 1 1 2 46. What is the output of this sequence of three shell commands: echo x >abc ; ls >abc abc ; wc abc a. 1 1 4 abc b. no output c. 1 1 2 abc d. 0 0 0 abc e. 1 1 3 abc 47. In an empty directory, how many arguments are passed to the cat command in this bash command line? date >a1 ; touch a2 ba ca ; cat a* a. 1 b. 2 c. 4 d. 3 e. none 48. What is the output on your screen of the following command sequence if run in a directory containing 123 files with names that are all the numbers from 1 to 123 inclusive: glob="*" ; echo "$glob" a. "$glob" b. * c. the file names 1 through 123 d. the file names 1 through 123, surrounded by quotes e. $glob 49. What appears on your screen after this bash shell command line? echo hi >a ; echo a | wc -c a. no output b. 2 c. 1 d. 4 e. 3 50. What appears on your screen after this bash shell command line? echo hi >ls ; cat ls > wc a. hi b. 1 1 3 c. ls d. 1 1 2 e. no output 51. Which command sequence below does not generate an error message from the last command in the sequence? a. mkdir foo foo/bar ; rmdir foo b. date >foo ; cp foo/. bar c. mkdir foo ; sleep foo d. mkdir one one/two ; rmdir one/two e. cat /etc/passwd > mail idallen@ncf.ca 52. How many arguments and options are there to the command: ls -ls /cat a. Two arguments, no options. b. Two options, no arguments. c. Two command line arguments, one of which contains two bundled options. d. A three-letter file name and a /cat switch option argument. e. Two arguments, one of which is a single option and the other is a pathname. 53. If my current directory is /home, which of these pathnames is equivalent to the pathname /home/a/b/c? a. ../a/b/c b. ../home/b/c c. ./home/a/b/c d. ./a/b/c e. /a/b/c 54. What is the output of this command sequence: echo bat >one ; echo sky | head -2 one a. bat b. bat followed by sky c. an error message d. sky followed by bat e. sky 55. What appears on your screen after this bash shell command line? echo hi >out | wc -c a. 1 b. no output c. 0 d. 3 e. 2 56. What is in file out after running this bash shell command line? echo a >out b c a. b c b. echo a c. a b c d. a e. no output 57. In the output of the command ls -a, the one-character name . signifies what? a. A current file. b. The parent directory. c. A name that is hidden. d. A name with an unprintable character. e. The current directory. 58. Which of these statements is true? a. Only single quotes are strong enough to stop shell glob (wildcard) patterns from expanding. b. If /y is an empty directory, echo /y/* produces an error message. c. If /x is an empty directory, sort /x/* produces an error message. d. Only backslashes are strong enough to stop shell glob (wildcard) patterns from expanding. e. Only double quotes are strong enough to stop shell glob (wildcard) patterns from expanding. 59. What is the output of this command sequence: echo foo >file ; echo bar | sort file a. an error message b. foo c. bar d. bar followed by foo e. foo followed by bar 60. How many arguments does the shell pass to this echo command: echo 'And it's not hard, it's just logical.' a. Six arguments. b. Four arguments. c. Three arguments. d. Seven arguments. e. Five arguments. 61. What appears on your screen after this sequence of commands: echo one >x ; cp x y ; echo two >>y ; sort x >y ; cat y a. two followed by one b. two c. one followed by two d. one e. empty file - no output on the screen 62. If cow is a sub-directory that contains only the file dog, what happens after this command: mv cow/dog cow/././cat a. the command fails because the name cow/././cat does not exist b. the directory cow is now empty c. there is a second copy of the file dog in the file named cat d. the directory cow now contains only a file named cat e. the command fails because the name cat does not exist 63. How many arguments and options are there to the command: wc -l wc ; wc wc >wc ; cat wc a. wc b. 1 1 3 wc c. no output d. 1 1 2 wc e. 0 0 0 wc 65. Which of these command sequences will make file out contain all of the content of file in1 followed by all of the content of file in2? a. mv in1 in2 >out b. echo in1 in2 >out c. cp in1 >out in2 >out d. cat in1 in2 >out e. cp in1 in2 >out 66. If file a contains twenty lines, and file b contains thirty lines, then how many lines are in file out after this sequence of bash shell commands: cat a b >c ; head c >c ; sort a b c >out a. 100 b. 30 c. no lines (empty file) d. 60 e. 50 67. What text is output by this bash shell command sequence: echo dog >out ; echo cat | sort out a. out b. dog c. cat d. dog followed by cat e. cat followed by dog 68. If foo is a sub-directory that contains only the file single, what happens after this command: mv ./foo/single foo/../double a. the command fails because the name double does not exist b. the command fails because the name foo/../double does not exist c. the directory foo is now empty d. the directory foo now contains only a file named double e. there is a second copy of the file single in the file named double 69. Which of the following shell command lines displays all the names in the current directory that are exactly three digits long (and no others)? a. echo ??? b. echo [3][3][3] c. echo [0-9][0-9][0-9] d. echo [?][?][?] e. echo [1-3][1-3][1-3] 70. In an empty directory, how many words are in file out after this bash shell command line? touch 1 2 3 2 1 ; ls >out a. no output (empty file) b. 3 c. 4 d. 5 e. 6 71. Which of the following pathnames always leads to the same file named: /etc/passwd? a. ./etc/passwd b. ../etc/passwd c. /etc/./etc/../passwd d. /etc/passwd/. e. /etc/../etc/passwd 72. In an empty directory, what is the length of the longest file name created by the following shell two-command sequence: var='a ab abc abcd abcde' ; touch "$var" a. 15 characters b. 4 characters c. 3 characters d. 19 characters e. 5 characters 73. What is the output of this sequence of three shell commands: echo hi >hi ; head hi >hi ; wc hi a. 0 0 0 hi b. 1 1 2 hi c. 1 1 3 hi d. no output e. 2 2 4 hi 74. If directory foo contains only these four three-character file names: .x1, .x2, .z3, .z., then what is the output of the following bash shell command line: echo foo/??? a. no output b. foo/.z. c. foo/.x1 foo/.x2 foo/.z3 d. foo/.x1 foo/.x2 foo/.z3 foo/.z. e. foo/??? 75. What is the output of this successful command sequence? cd /home/dir ; mkdir one ; mkdir two ; pwd a. /home/dir/two b. /home/dir/one c. /two d. /home/dir e. /home/dir/one/two 76. When doing an ls -a, the output pathname that is a double dot (..) signifies what? a. The parent directory. b. The current directory. c. A hidden file. d. The root directory. e. A file or directory with double links. 77. If file x contains ten lines, and file y contains twenty lines, then how many lines are in file cat after this sequence of bash shell commands: sort x y >z ; tail -5 y >y ; sort x y z >cat a. 45 b. no lines (empty file) c. 60 d. 40 e. 50 78. If my current directory is /bin, which of these pathnames is equivalent to the file name /bin/ls? a. ls/. b. ../../bin/ls c. ../bin/ls/. d. ./bin/ls e. /root/bin/ls 79. What command can you use to remove a directory that isn't empty? a. deldir -r dir b. rmdir -r dir c. mv -r dir d. del -r dir e. rm -r dir 80. What would you see if you typed this command: cat /users a. The contents of your subdirectory named users b. The contents of your directory named users c. The contents of the file users located in the parent directory d. The contents of the file users located in your home directory e. The contents of the file users located in the root directory 81. Which command line displays the contents of the Unix passwd file one page at a time? a. cat /etc/passwd >less b. /etc/passwd >less c. /etc/passwd | less d. less /etc/passwd d. grep ./? /etc/passwd e. grep /etc/passwd ./? 83. In the output of the command ls -a, a dot that begins a name signifies what? a. A current file. b. The current directory. c. The parent directory. d. A name with an unprintable character. e. A name that is hidden. 84. How many arguments does the shell pass to this echo command: echo "cow "y " bat 'man x' " pig'a "hop' a b a. Six arguments. b. Eleven arguments. c. Four arguments. d. Seven arguments. e. Five arguments. 85. How many arguments does the shell pass to this echo command: echo " 1 2 "three ' 4 ' five"6" a. Four arguments. b. One argument. c. Five arguments. d. Three arguments. e. Nine arguments. 86. If file foo contains nine lines, each of which is the one-digit line number of the line in the file (1 through 9), what is the output on your screen of this command: cat foo foo | sort -r | head -5 | tail -1 a. 8 b. 9 c. 5 d. 7 e. 6 87. In an empty directory, what is the length of the longest file name created by the following sequence: var='a ab abc abcd abcde' ; touch '$var' a. 15 characters b. 19 characters c. 5 characters d. 4 characters e. 3 characters 88. Which command sequence below outputs only lines 10-15 of the 16-line file named hex? a. head -15 hex | tail -6 b. head -10 hex | tail -15 hex c. head -16 hex | tail -5 hex d. tail -10 hex | head -16 hex e. tail -16 hex | head -10 89. What is the output on your screen of the following sequence of commands: echo hi >wc ; wc wc >hi ; cat hi a. 0 0 0 wc b. 1 1 3 wc c. 1 1 2 wc d. no output e. hi 90. Which command line lists all possible utilities available for compiling programs? a. grep /etc/* compile b. grep compile /etc/* c. man * | grep compile d. man compile e. apropos compile 91. If directory /a contains these seven two-character file names: aa, ab, ac, ad, a?, a*, a., then which shell command below will remove only the single name a* from the directory (and no others)? a. rm /a/a\* b. rm /a* c. rm /a/a* d. rm /a/* e. rm /a/a? 92. If my current directory is /etc, which of these pathnames is equivalent to the file name /etc/passwd? a. ../passwd b. ./etc/passwd c. ./passwd d. ../etc/passwd/. e. /passwd 93. How many arguments does the shell pass to this echo command: echo ' one two ' three ' four ' 5'6' a. Six arguments. b. Four arguments. c. Five arguments. d. Nine arguments. e. One argument. 94. If file foo contains nine lines, each of which is the number of the line in the file, what is the output of this command: cat foo foo | sort | tail -4 | head -1 a. 4 b. 1 c. 8 d. no output e. 6 95. Which of the following shell command lines displays only the names in the current directory that are exactly three alphabetic letters long? a. echo [?][?][?] b. echo [a-zA-Z][a-zA-Z][a-zA-Z] c. echo ??? d. echo [0-3][0-3][0-3] e. echo *** 96. How can you ask the bash (Linux) shell to complete commands or file names for you? a. Type [CONTROL]-[ALT]-[DEL] and the shell will present a menu of commands. b. Type [ALT]-[F2] the shell will present a menu of commands. c. Type [CONTROL]-[D] and the shell will present a menu of commands. d. You can type the first part of the command or file name and press the ALT key. e. You can type the first part of the command or file name and press the TAB key. 97. Which of these command sequences will make file foo contain all of the content of file a followed by all of the content of file b? a. cat a >foo ; cat b >>foo b. mv a b >foo c. cp a >foo ; cp b >>foo d. cp a b >foo e. echo a b >foo 98. What appears on your screen after this bash shell command line? echo hi | wc -c a. 1 b. no output c. 0 d. 3 e. 2 99. If file /a contains thirty lines, and file /b contains fifty lines, then how many lines are in file /c after this sequence of shell commands: cat /a /b >/c ; sort /c >/c ; sort /c /a /b >/c a. 50 b. 30 c. no lines (empty file) d. 80 e. 160 100. What command shows all the lines in file /etc/group that contain the string idallen? a. grep /etc/group idallen b. grep idallen /etc/group c. cat /etc/group > grep idallen d. cat /etc/group | wc idallen e. grep idallen >/etc/group 101. What appears on your screen after this bash shell command line? mkdir foo ; rmdir foo | wc -c a. 0 b. 1 c. 3 d. 4 e. no output 102. What is in file cow after running this bash shell command line? echo one two >cow three a. no output (empty file) b. one two cow three c. one two three d. echo one two e. one two 103. Which command sequence outputs inode/filename pairs for names in the current directory, sorted by inode number? a. ls -i * > sort b. ls -ia | sort -n c. ls ./* | sort -node d. sort ls -ia e. ls -node * > sort -n 104. Which one of the following commands will leave file1 non-empty? a. cat file1 > file1 b. head file1 > file1 c. tail file1 > file1 d. sort file1 > file1 e. wc file1 > file1 105. Select the correct bash shell order of command line processing: a. quotes, variables, redirection, globs b. quotes, variables, globs, redirection c. redirection, quotes, globs, variables d. quotes, redirection, variables, globs e. quotes, globs, variables, redirection 106. What is in the file named file after this command sequence: echo a >c ; echo b >>c ; mv c d >file a. nothing - file is empty - no data b. a c. a followed by b d. b e. no such file (nonexistent file) 107. Which of these statements is true? a. The file command creates a new, empty file in the current directory b. To interrupt a Unix process from the keyboard, type [CONTROL]-[D]. c. Command apropos is an exact synonym for command man. d. To erase an entire line of typing, type [ALT]-[DELETE]. e. To indicate End-of-File (no more input) to a program, type [CONTROL]-[D]. 108. Which of these statements is true? a. You can only login to Unix once per userid; you cannot be logged in to the same machine twice. b. To indicate End-of-File (no more input), type [CONTROL]-[E]. c. Unix commands must be entered in lower-case letters. d. To erase an entire line of typing, type [CONTROL]-[E]. e. Unix commands can be entered in upper-case or lower-case letters; they are equivalent. 109. Which command below removes only this five-character file name containing a special character (and no others): date? a. rm ./date? b. rm date\* c. rm date/? d. rm ./date\? e. rm date\\? 110. If I am in my home directory named /home/ian and mt is an empty sub- directory, what is true after this command line: who >../ian/cat ; cp ./mt/../cat ./mt/../dog a. the directory mt now contains two files b. the directory mt now has a file named dog in it c. the command fails because the path ./mt/../cat does not exist d. the directory mt is still empty e. there is a second copy of the file named who in the file dog 111. If file twenty contains twenty lines, and file thirty contains thirty lines, then how many lines are output by this command: tail thirty | cat twenty a. 50 b. 20 c. 30 d. 21 e. no lines (no output) 112. If your terminal type is xterm, what is the output of this bash shell command line? echo '$TERM' a. no output b. $TERM c. 'xterm' d. '$TERM' e. xterm 113. In an empty directory, what appears on your screen after this bash command line? touch a ; ls | wc -l a. 0 b. no output c. 1 d. 2 e. 3 114. Which command line lists all possible utilities available for sorting files? a. grep /etc/passwd sort b. man -k sort c. man sort d. grep sort /etc/passwd e. man | grep sort 115. Which of the command lines below can generate a non-empty file? a. wc -l /a/b >/a/b b. head -5 /a/b >/a/b c. cat /a/b /a/b /a/b >/a/b d. tail /a/b >/a/b e. sort /a/b >/a/b 116. What is the output of this bash shell command line in an empty directory? echo '$SHELL' a. $SHELL b. '$SHELL' c. '/bin/bash' d. /bin/bash e. no output 117. In an empty directory, what appears on your screen after this bash command line? touch a ; ls >wc -l a. 1 b. no output c. 2 d. 3 e. 0 118. What text is output by this bash shell command sequence: echo cow >foo ; echo dog | head -1 foo a. foo b. cow c. dog followed by cow d. dog e. cow followed by dog 119. Which of the following VI/VIM key sequences will move the entire line on which the cursor resides to after the line that follows it (i.e. it would move line 5 to be line 6 and line 6 would become line 5)? a. DDP b. DDp c. ddP d. :dp e. ddp 120. If file /a contains 20 lines, and file /b contains 30 lines, then how many lines are in file /c after this sequence of shell commands: sort /a /b >/c ; cat /a >>/b ; sort /c /b /a >/c a. 50 b. 120 c. no lines (empty file) d. 70 e. 80 121. What is true about this bash shell command line? date >ls ; ls -ls ls >wc a. The wc command counts the output of the ls command. b. The shell finds and executes three different commands. c. The ls command receives the output of date on standard input. d. The ls command is executed more than once. e. The file wc has one line in it. Answer Key - CST8129 - Ian Allen - Fall 2005 - CST8129 Practice Test 1. b 57. e 2. e 58. c 3. c 59. b 4. c 60. b 5. a 61. d 6. e 62. d 7. b 63. d 8. c 64. e 9. d 65. d 10. a 66. e 11. a 67. b 12. b 68. c 13. b 69. c 14. b 70. c 15. a 71. e 16. d 72. d 17. d 73. a 18. b 74. e 19. c 75. d 20. d 76. a 21. e 77. d 22. c 78. b 23. a 79. e 24. e 80. e 25. d 81. d 26. c 82. a 27. c 83. e 28. b 84. e 29. a 85. d 30. d 86. d 31. a 87. d 32. e 88. a 33. c 89. b 34. d 90. e 35. e 91. a 36. a 92. c 37. b 93. b 38. d 94. c 39. b 95. b 40. b 96. e 41. e 97. a 42. d 98. d 43. d 99. d 44. d 100. b 45. b 101. a 46. a 102. c 47. b 103. b 48. b 104. e 49. b 105. d 50. e 106. a 51. d 107. e 52. c 108. c 53. d 109. d 54. a 110. d 55. c 111. b 56. c 112. b 113. c 114. b 115. a 116. a 117. b 118. b 119. e 120. d 121. e Count of a: 20 17% Count of b: 28 23% Count of c: 20 17% Count of d: 30 25% Count of e: 23 19% With 5 choices: 121 Macro .cmd split with indent: 60