DAT2330 Practice Test - Ian Allen - Winter 2003 20 minutes Evaluation: 20 Questions Name: _________________________ Important Instructions 1. Read all instructions and both sides of the page. 2. Manage your time when answering questions on this test. Answer the questions you know, first. _________________________________________________________________ Multiple Choice - 20 Questions (Office use only: 11 13 9 14 20 10 3 4 16 15 2 7 8 12 5 19 1 18 6 17) 1. What would you type to change the permissions on a file to rw-r-xr--? a. chmod 351 file b. chmod 654 file c. chmod 212 file d. chmod 221 file e. chmod 530 file 2. 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\? 3. 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. no output b. 1 1 3 /a/x c. 2 2 4 /a/x d. 1 1 2 /a/x e. 0 0 0 /a/x 4. 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'' 5. What would you type to change the permissions on a file to --x-wx-w-? a. chmod 654 file b. chmod 121 file c. chmod 122 file d. chmod 322 file e. chmod 132 file 20 Questions DAT2330 Practice Test - 0% 45 minutes DAT2330 - Ian Allen - Winter 20-2- 45 minutes 6. 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* b. rm /a/a? c. rm /a/a\* d. rm /a/a* e. rm /a/* 7. Which command below removes only this four-character file name containing a special character (and no others): abc* a. rm abc\\* b. rm abc\* c. rm abc* d. rm abc//* e. rm abc/* 8. Which command below removes only this four-character file name containing a special character (and no others): *xyz a. rm *'xyz' b. rm '*xyz' c. rm ''*xyz d. rm *xyz e. rm ''*xyz'' 9. If cow is a sub-directory that contains only the file dog, what happens after this command: mv cow/dog cow/././cat a. the directory cow now contains only a file named cat b. the command fails because the name cow/././cat does not exist c. there is a second copy of the file dog in the file named cat d. the command fails because the name cat does not exist e. the directory cow is now empty 10. How many arguments are there to this echo command: echo " one '2 three' 4 "five 6 ' 7 "8 ' >out a. Six arguments. b. Four arguments. c. Three arguments. d. Five arguments. e. Two arguments. 11. 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-R] b. [CTRL-C] c. [CTRL-D] d. [CTRL-U] e. [CTRL-I] 20 Questions DAT2330 Practice Test - 0% 45 minutes DAT2330 - Ian Allen - Winter 20-3- 45 minutes 12. If I have a directory owned by me named /a/b/c/d, which of the following actions would increase its link count by exactly one? a. create one subdirectory named /a/b/c/d/e b. create one subdirectory named /a/b/c/d2 c. create one subdirectory named /a/b/c/d d. create one file named /a/b/c/d2 e. create one file named /a/b/c/d/e 13. Which of the following is true, given this long directory listing: drwxr-x--x 71 ian user 512 May 30 12:35 dir a. The number 512 is the inode number of this directory. b. The number 512 is the count of links (names) this directory has. c. The number 71 is the size of this directory. d. The number 71 is the count of links (names) this directory has. e. The number 71 is the inode number of this directory. 14. If you type the command cat which of the following key sequences will send an EOF and take you immediately back to the command prompt? a. [CTRL-U] b. [CTRL-R] c. [CTRL-I] d. [CTRL-D] e. [CTRL-C] 15. How many arguments are there to this echo command: echo ' one two ' three ' four ' 5'6' a. Four arguments. b. One argument. c. Nine arguments. d. Six arguments. e. Five arguments. 16. Given an existing file of yours named wc, what is the output of this sequence of three shell commands: echo hi >wc ; sort wc >wc ; cat wc a. 0 0 0 wc b. 1 1 3 wc c. no output d. 2 2 4 wc e. 1 1 2 wc 17. In the output of the command ls -a, a dot that begins a name signifies what? a. A name that is hidden. b. A current file. c. The parent directory. d. The current directory. e. A name with an unprintable character. 20 Questions DAT2330 Practice Test - 0% 45 minutes DAT2330 - Ian Allen - Winter 20-4- 45 minutes 18. Which of the following is true, given this long directory listing: drwxr-x--x 512 ian user 712 May 30 12:35 dir a. The number 512 is the inode number of this directory. b. The number 512 is the size of this directory. c. The number 512 is the count of links (names) this directory has. d. The number 712 is the count of links (names) this directory has. e. The number 712 is the inode number of this directory. 19. 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 foo/../double does not exist b. there is a second copy of the file single in the file named double c. the directory foo now contains only a file named double d. the directory foo is now empty e. the command fails because the name double does not exist 20. If I have a directory owned by me named /a/b/c/7, which of the following actions would increase its link count by exactly one? a. create one file named /a/b/c/7de b. create one subdirectory named /a/b/c/d/e c. create one subdirectory named /a/b/c/7/d2 d. create one subdirectory named /a/b/c/7e e. create one file named /a/b/c/7/d2 20 Questions DAT2330 Practice Test - 0% 45 minutes DAT2330 - Ian Allen - Winter 20-5- 45 minutes Answer Key - DAT2330 - Ian Allen - Winter 2003 - DAT2330 Practice Test - 0% Office use only: 11 13 9 14 20 10 3 4 16 15 2 7 8 12 5 19 1 18 6 17 1. b 2. e 3. e 4. d 5. e 6. c 7. b 8. b 9. a 10. c 11. b 12. a 13. d 14. d 15. a 16. c 17. a 18. c 19. d 20. c Count of a: 4 20% Count of b: 4 20% Count of c: 5 25% Count of d: 4 20% Count of e: 3 15% With 5 choices: 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Macro .cmd splits: 5 Macro .ans splits: 0 20 Questions DAT2330 Practice Test - 0% 45 minutes