0% found this document useful (0 votes)
21 views15 pages

Practice Test 3

Uploaded by

dashunihongwei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views15 pages

Practice Test 3

Uploaded by

dashunihongwei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

188 M/C Questions -1- 1 Minute Per Question 188 M/C Questions -2- 1 Minute Per Question

4. What is the output on your screen of the following sequence of commands:


PRINT Name: x=pig ; [ -z $x ] ; echo $?
One-Answer Multiple Choice 188 Questions Weight 40% a. 0
b. no output
☞ Read all the words of these instructions and both sides (back and front) of all pages. c. test: $x: integer expression expected
☞ Manage your time. Answer questions you know, first. One Answer per question. d. the number 0 or 1 followed by another 0 or 1 on a new line
☞ PRINT your Name and Lab on this Question Sheet. You may write or draw on this sheet. e. 1
☞ Use your full, unabbreviated name on the mark-sense form. Do not abbreviate your name.
☞ Enter your NAME, Student Number, and Answers. Fill in the bubbles with pencil, no pen. 5. User bob is in groups bg1 and bg2. User pat is in group pgg.
☞ The answer to the last question about reading these test instructions is: 123 d-wxr-xrw- 2 bob pgg 60 Jan 1 1:00 foo
-r-xrwxr-x 1 bob bg1 0 Jan 1 1:00 foo/bar
a. pat can access and write on the file
191. Answer 191 is D Your Test Version is: b. bob can list names in the directory
192. Answer 192 is A D A B B A D c. pat can rename the file
193. Answer 193 is B Fill in the bubbles for the above six letters as d. bob can create a new file in the directory
194. Answer 194 is B six answers 191 through 196 on the back side e. bob can access and write on the file
195. Answer 195 is A of the Scantron form, in the lower-right-most
196. Answer 196 is D 6. A crontab entry of 0 6 * * * /sbin/somescript
answer column. would run somescript when and how often?
a. at 12:06am every day
1. In a directory containing one file named dog, what is the output on your screen b. at 12:06am every business day
after this command line: 1>/dev/null ls * c. at 6:00am every business day
a. * d. at 12:06am every business day and Saturday
b. no output e. at 6:00am every day
c. dog 7. User bob is in groups bg1 and bg2. User pat is in group pgg.
d. bash: 1>/dev/null: command not found drw-rw-rwx 2 pat bg1 60 Jan 1 1:00 foo
e. ls: *: No such file or directory -rwxrwxrwx 1 pat ted 0 Jan 1 1:00 foo/bar
2. Can three different files have the same inode number on three different file systems? a. bob can rename the file
a. no: inode numbers only apply to directories, not files b. pat can create a new file in the directory
b. no: you can’t have inode numbers on three file systems c. bob can list names in the directory
c. no: inode numbers are unique across all file systems d. bob can access and write on the file
d. yes: inode numbers are only unique inside a file system e. pat can rename the file
e. yes: if the files are all names for the same inode 8. If I mount one file system on directory /a and another file system on directory /b,
3. When a personal crontab job runs, the current working directory is set to: how can I link the existing file /a/foo to the new pathname /b/new?
a. the directory with the name /home a. ln -s /a/foo /b/new b. ln /b/new /a/foo
b. the system ROOT directory c. ln /a/new /b/foo d. ln -s /b/new /a/foo
c. the directory with the name /root e. ln /a/foo /b/new
d. the HOME directory of the user who created the job 9. User bob is in groups bg1 and bg2. User pat is in group pgg.
e. the current directory that was in use when the crontab job was created d--xr----x 2 bob ted 60 Jan 1 1:00 foo
--w--w-r-x 1 bob bg1 0 Jan 1 1:00 foo/bar
a. bob can access and write on the file
b. bob can create a new file in the directory
c. bob can list names in the directory
d. pat can rename the file
e. pat can access and write on the file

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -3- 1 Minute Per Question 188 M/C Questions -4- 1 Minute Per Question

10. If a script named bar contains a loop that starts: for i do 17. A shell script named bar is executed as follows:
and the script is executed using this command line: ./bar "a b" "c d e" f
./bar a ' b d ' e f " g h " a Inside the script is the line: echo "$3"
how many times will the loop iterate? What is the output on your screen from this line?
a. 7 iterations b. 8 iterations c. 6 iterations a. $3 b. f c. c d e
d. 9 iterations e. 1 iteration d. a b e. "f"
11. Given my directory containing a file, which octal permissions allow me to access 18. What command terminates processes based on their name (not safe!):
and append data to the file but not delete the file? a. dmesg b. crontab c. killall
a. Directory: 600 File: 700 b. Directory: 400 File: 400 d. ps lxww e. kill
c. Directory: 500 File: 100 d. Directory: 500 File: 200 19. What command manipulates your personal list of repeated scheduled commands:
e. Directory: 200 File: 200 a. showall b. ps lxww c. psmine
12. User bob is in groups bg1 and bg2. User pat is in group pgg. d. dmesg e. crontab
dr-xr-x-w- 2 bob pgg 60 Jan 1 1:00 foo 20. In an empty directory, what permissions are on file ??? after these commands:
-r-xrwxr-x 1 bob bg1 0 Jan 1 1:00 foo/bar touch ??? *** ; chmod 111 *
a. bob can create a new file in the directory chmod 222 ??? ; chmod 444 '***'
b. bob can list names in the directory a. rw-rw-rw- b. r--r--r-- c. -wx-wx-wx
c. bob can access and write on the file d. --x--x--x e. -w--w--w-
d. pat can access and write on the file
21. When a user named bob runs a command in an executable file owned by foo, in a
e. pat can rename the file
directory owned by root, the file executes with the permissions of:
13. Given this successful command line (note the dot argument): a. root and bob b. root c. bob
cd /home/foo ; mkdir bar ; cd bar ; chmod a-x . d. root and foo e. foo
Which of the following subsequent commands will execute without any "permission
denied" errors? 22. If bar is an executable script containing the line animal=dog then what is the
a. ls /home/foo/bar/. b. ls .. bash output of this sequence of three commands:
animal=pig ; ./bar ; echo "the '$animal' ate"
c. ls /home/foo/bar/.. d. ls /home/foo/bar
e. ls . a. the $animal ate b. the 'animal' ate
c. the 'pig' ate d. the '$animal' ate
14. The minimum permissions you need to append to a file foo in directory a are: e. the 'dog' ate
a. rwx on a, none on foo b. rwx on a, rw on foo
23. User bob is in groups bg1 and bg2. User pat is in group pgg.
c. x on a, w on foo d. wx on a, none on foo
dr-xrwx-wx 2 pat ted 60 Jan 1 1:00 foo
e. wx on a, w on foo -r-xr-xrwx 1 pat bg2 0 Jan 1 1:00 foo/bar
15. If a shell script myscript.sh is called this way: a. bob can access and write on the file
./myscript.sh a b c b. bob can list names in the directory
and the first line inside the script below the script header is c. pat can access and write on the file
echo "$#$1" ; shift
d. bob can rename the file
what is the output of that line?
e. pat can create a new file in the directory
a. 4c b. 3a c. 3b d. 2b e. 2a
24. The octal mode of a directory that allows the user to create new files in it, but not to
16. Dereference the following symlink bar into its equivalent absolute path: list any names in it:
ln -s ../b/../../a/../foo /tmp/a/b/bar
a. 100 b. 400 c. 300 d. 200 e. 500
a. /tmp/b/bar b. /tmp/foo c. /tmp/a/b/bar
d. /tmp/b/foo e. /tmp/a/foo

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -5- 1 Minute Per Question 188 M/C Questions -6- 1 Minute Per Question

25. In an empty directory, what is output on your screen by: 32. User bob is in groups bg1 and bg2. User pat is in group pgg.
mkdir -p a/b/c 1/2/3 ; mv a 1/2 ; find . -name c d--x----w- 2 pat ted 60 Jan 1 1:00 foo
a. ./1/2/3/a/b/c b. ./1/2/a/b/c --w-r-xrwx 1 pat bg2 0 Jan 1 1:00 foo/bar
c. ./1/2/3/a/b d. ./1/2/a a. pat can access and write on the file
e. ./1/a b. bob can access and write on the file
26. Given the following, can user bird in group sesame copy ./foo to bar? c. pat can rename the file
drwx-wx--x 2 root sesame 4096 Oct 7 14:00 . d. bob can list names in the directory
--wxrwxrwx 1 bird sesame 123 Oct 4 14:05 foo e. bob can create a new file in the directory
a. No, because the directory is not readable by bird 33. If a shell script myscript.sh is called this way:
b. Yes, because bird has write permissions on foo ./myscript.sh a b c
c. Yes; permissions don’t apply because bird owns foo and the first line inside the script below the script header is
d. No, because the directory has no write permissions for bird shift ; echo "$#$1"
e. No, because foo has no read permissions for bird what is the output of that line?
27. In an empty directory, what is output on your screen by: a. 4c b. 2b c. 2a d. 3a e. 3b
mkdir -p a/b/c 1/2/3 ; mv a/b 1/2/3 ; find . -name c 34. Given my directory containing a file, which octal permissions allow me to delete the
a. ./1/2/3/b/c b. ./a/b/c c. ./1/2/3/c file from the directory, but not append data to the file?
d. ./1/2/a/b e. ./1/2/3/a/b a. Directory: 500 File: 500 b. Directory: 300 File: 400
28. The minimum permissions you need to read a file foo in directory a are: c. Directory: 100 File: 500 d. Directory: 300 File: 200
a. wx on a, w on foo b. rwx on a, none on foo e. Directory: 100 File: 300
c. x on a, r on foo d. wx on a, none on foo 35. Which command counts the number of Unix permission groups you are in?
e. rwx on a, rw on foo a. umask | wc b. wc groups
29. What value umask gives a new file permissions r--r-----? c. groups | wc d. id | wc
a. 440 b. 237 c. 110 d. 446 e. 220 e. echo groups | wc
30. When a user named bob runs a command in a setuid executable file owned by 36. Which of the following could you use as options for the tar command to extract a
foo, in a directory owned by root, the file executes with the permissions of: gzip-compressed archive?
a. root and foo b. bob c. root a. -tgz b. ezf c. egf d. -czf e. xzf
d. root and bob e. foo 37. If variable a might contain nothing (a null value - defined but empty), which
command sequence correctly tests for this and prints the date?
31. User bob is in groups bg1 and bg2. User pat is in group pgg.
drw------x 2 pat ted 60 Jan 1 1:00 foo a. if [ '''' = $a ] ; then date ; fi
--w--w-r-x 1 pat bg1 0 Jan 1 1:00 foo/bar b. if test "" -eq $a ; then date ; fi
a. bob can rename the file c. if test "" = "$a" ; then date ; fi
b. pat can access and write on the file d. if [ $a = /dev/null ] ; then date ; fi
c. bob can list names in the directory e. if [ "$a" = * ] ; then date ; fi
d. bob can access and write on the file 38. Given the following, can user bird in group sesame append to ./foo?
e. bob can create a new file in the directory dr-xr-xr-x 2 root sesame 4096 Oct 7 14:00 .
-rw-r-xr-x 1 bird sesame 123 Oct 4 14:05 foo
a. No, because bird has no write permission on the directory
b. No, because the directory is not accessible to bird
c. Yes, because bird has write permissions on foo
d. No, because execute permissions are not set for bird on foo
e. Yes; permissions don’t apply because bird owns foo

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -7- 1 Minute Per Question 188 M/C Questions -8- 1 Minute Per Question

39. What is the output (if any) of this program fragment? (There are blanks between all 45. User bob is in groups bg1 and bg2. User pat is in group pgg.
the digits in the word list section of the for loop.) d-wx----w- 2 pat pgg 60 Jan 1 1:00 foo
s=0 -rwxrwxr-x 1 bob bg2 0 Jan 1 1:00 foo/bar
for i in 1 2 3 4 a. bob can access and write on the file
do b. bob can create a new file in the directory
s=$((s+i)) c. pat can access and write on the file
done d. bob can list names in the directory
echo "$s" e. pat can rename the file
a. 1234 b. 4321 c. 1 2 3 4 46. User bob is in groups bg1 and bg2. User pat is in group pgg.
d. 1 e. 10 dr-xrwx-wx 2 pat pgg 60 Jan 1 1:00 foo
40. What value umask gives a new directory permissions rw--w---x? -r-xrwxr-x 1 bob bg2 0 Jan 1 1:00 foo/bar
a. 432 b. 156 c. 211 d. 421 e. 621 a. pat can rename the file
41. User bob is in groups bg1 and bg2. User pat is in group pgg. b. bob can create a new file in the directory
dr-xrw-rwx 2 pat bg1 60 Jan 1 1:00 foo c. bob can list names in the directory
-rwxrwxrwx 1 pat ted 0 Jan 1 1:00 foo/bar d. bob can access and write on the file
a. bob can list names in the directory e. pat can access and write on the file
b. pat can create a new file in the directory 47. If a=123 and b=456 then what is the output of the following sequence of
c. pat can rename the file commands: if $a = $b ; then echo $a ; fi
d. bob can access and write on the file a. test: a=123: integer expression expected
e. bob can rename the file b. test: $a: string expression expected
42. What is the output on your screen of the following command sequence: c. no output
i=04; test $i = 4 ; echo $? d. 123
a. 1 e. bash: 123: command not found
b. no output 48. What value to chmod would change the permissions on a file to rw-r--r--?
c. test: $i: integer expression expected a. 644 b. 244 c. 211 d. 344 e. 311
d. the number 0 or 1 followed by another 0 or 1 on a new line 49. To list your personal crontab, type:
e. 0
a. cat crontab b. crontab -l
43. In an empty directory, what permissions are on file ??? after these commands: c. /var/log/crontab d. atq
touch ??? *** ; chmod 111 * e. /etc/crontab
chmod 222 ? ; chmod 444 '*'
50. Which of these statements is true?
a. -wx-wx-wx b. -w--w--w- c. --x--x--x
d. rw-rw-rw- e. r--r--r-- a. You only need "r--" permission on directory "foo" for "ls -l foo" to
work.
44. To send a KILL signal to a process with process ID PID, which of the following b. To make a hard link to file "foo" named "bar", file "foo" must exist.
commands would you use? c. If you give me write permission on a file owned by you, I can then use chmod
a. send PID KILL b. send -KILL PID to change its permissions.
c. kill -KILL PID d. kill PID KILL d. The "ln" command takes two arguments, so the maximum number of hard links
e. signal -KILL PID a file can have is two.
e. You can make a hard link to a directory.

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -9- 1 Minute Per Question 188 M/C Questions -10- 1 Minute Per Question

51. If a=123 and b=456 then what is the output of the following sequence of 58. The octal mode of a directory that allows the user to list the names in it, but not to
commands: if [$a = $b] ; then echo $a ; fi create files or to access any of the files:
a. bash: [123: command not found a. 200 b. 100 c. 500 d. 400 e. 300
b. no output 59. If archive.tar.gz is a compressed tar archive, which command could you run
c. test: a=123: integer expression expected to produce a listing of its contents without extracting it?
d. 123 a. tar -tzf archive
e. test: $a: string expression expected b. tar -tgz archive.tar.gz
52. Dereference the following symlink bar into its equivalent absolute path: c. tar -tgz archive
ln -s ../b/../../a/./foo /tmp/a/b/bar d. tar -tzf archive.tar.gz
a. /tmp/a/b/bar b. /tmp/foo c. /tmp/a/foo e. tar -xzf archive.tar.gz
d. /tmp/b/bar e. /tmp/b/foo 60. Which line is from the Standard Script Header in this course?
53. In a shell case structure, the case segment that will GLOB match the text a, b, a. PATH=/bin:ur/bin b. PATH=/bin:/usr/bin
or c, is coded as c. PATH=/bin:/urs/bin d. PATH=/bin:/user/bin
a. a|b|c ) b. a:b:c ) c. a,b,c ) e. PATH=/bin:user/bin
d. a/b/c ) e. a\b\c ) 61. The octal mode of a directory that allows the user to access files if they know their
54. Which command line makes a directory dir into which anyone can put a file, but names, but not to list or to change the names:
in which nobody can see the names of the files that are there? a. 300 b. 200 c. 100 d. 500 e. 400
a. mkdir dir ; chmod 333 dir 62. Which of the following signals is strongest (cannot be handled or ignored)?
b. mkdir dir ; chmod 777 dir a. SIGSUSP b. SIGTERM c. SIGKILL
c. mkdir dir ; cd dir ; chmod go+wx . d. SIGHUP e. SIGINT
d. mkdir dir ; chmod 777 .
63. Which command sequence correctly searches for the string and then prints OK
e. mkdir dir ; cd dir ; chmod go-x .
if it is found inside the password file?
55. User bob is in groups bg1 and bg2. User pat is in group pgg. a. if test string = /etc/passwd ; then echo OK ; fi
d-w-rw---x 2 bob ted 60 Jan 1 1:00 foo b. if [ test string /etc/passwd ] ; then echo OK ; fi
--w-rwxrwx 1 pat bg1 0 Jan 1 1:00 foo/bar
c. if fgrep string /etc/passwd ; then echo OK ; fi
a. bob can list names in the directory d. if test string /etc/passwd ; then echo OK ; fi
b. bob can access and write on the file e. if [ fgrep string /etc/passwd ] ; then echo OK ; fi
c. pat can access and write on the file
d. pat can rename the file 64. What is the output on your screen of the following command sequence:
a=1 ; b=2 ; test $b -ge $a ; echo $?
e. bob can create a new file in the directory
a. test: $b: integer expression expected
56. The octal mode of a directory that allows the user to list the names in it, but not to b. 0
create files or to cd into the directory:
c. no output on screen
a. 200 b. 100 c. 300 d. 500 e. 400 d. the number 1 or 0 followed by another 1 or 0 on a new line
57. User bob is in groups bg1 and bg2. User pat is in group pgg. e. 1
dr-x-wx--x 2 bob ted 60 Jan 1 1:00 foo 65. Given the following, can user bird in group sesame append to foobar?
-r-x-w-r-x 1 bob bg1 0 Jan 1 1:00 foo/bar drwx--xrwx 2 root sesame 4096 Oct 7 14:00 .
a. bob can list names in the directory -rw------- 1 bird sesame 1024 Oct 4 14:05 foobar
b. bob can create a new file in the directory a. No, because execute permissions are not set for bird on foobar
c. bob can access and write on the file b. No, because sesame has no write permissions on foobar
d. pat can access and write on the file c. No, because the directory is not accessible to bird
e. pat can rename the file d. Yes, because bird owns foobar
e. Yes, because bird has write permissions on foobar

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -11- 1 Minute Per Question 188 M/C Questions -12- 1 Minute Per Question

66. Which expands to all the script arguments? 74. Given my directory containing a file, which octal permissions allow me to delete the
a. "$!" b. "$*" c. "$0" d. "$#" e. "$?" file from the directory, but not append data to the file?
67. Which of the following commands would result in an error? a. Directory: 700 File: 200 b. Directory: 600 File: 300
a. [ 3 = f ] b. [ 3 -eq 4 ] c. [ 3 -e 3 ] c. Directory: 500 File: 500 d. Directory: 600 File: 500
d. [ a != 4 ] e. [ a = 4 ] e. Directory: 300 File: 100
68. Process signals in increasing order of strength: 75. If guru=linus then which one of the following case patterns will match this
statement: case "$guru" in
a. HUP TERM KILL b. TERM KILL HUP
c. TERM HUP KILL d. KILL HUP TERM a. [linus] | [LINUS] ) echo yes ;;
e. HUP KILL TERM b. "linu?" ) echo yes ;;
c. * ) echo yes ;;
69. User bob is in groups bg1 and bg2. User pat is in group pgg. d. (*nus echo yes ;;
d-wx-w-rwx 2 pat bg2 60 Jan 1 1:00 foo
e. lin? ) echo yes ;;
-rwxrwxrwx 1 pat ted 0 Jan 1 1:00 foo/bar
a. pat can rename the file 76. What minimal permissions must you have on a directory to be able to execute
b. bob can create a new file in the directory successfully the command ls . from inside the directory?
c. bob can list names in the directory a. rw- b. r-x c. -wx d. --x e. r--
d. bob can rename the file 77. Dereference the following symlink bar into its equivalent absolute path:
e. bob can access and write on the file ln -s ../b/../b/../../foo /tmp/a/b/bar
70. Which command sequence correctly compares the two numbers and prints OK? a. /tmp/a/b/bar b. /tmp/b/foo c. /tmp/b/bar
a. if ( 3 < 4 ) ; then echo OK ; fi d. /tmp/a/foo e. /tmp/foo
b. if [ 4 -ge 3 ] ; then echo OK ; fi 78. User bob is in groups bg1 and bg2. User pat is in group pgg.
c. if [ 4 > 3 ] ; then echo OK ; fi drw---x--- 2 pat bg2 60 Jan 1 1:00 foo
d. if [ ! 4 -gt 3 ] ; then echo OK ; fi -r------w- 1 pat ted 0 Jan 1 1:00 foo/bar
e. if ( ! 4 < 3 ) ; then echo OK ; fi a. bob can rename the file
71. Under what directory are system log files usually stored? b. pat can rename the file
a. /bin/ b. /usr/bin c. /var/log c. pat can create a new file in the directory
d. /log/var e. /etc/log d. bob can access and write on the file
e. bob can list names in the directory
72. User bob is in groups bg1 and bg2. User pat is in group pgg.
dr---wx--- 2 pat bg2 60 Jan 1 1:00 foo 79. Which of the following commands would result in an error?
-rw-rw-r-x 1 pat ted 0 Jan 1 1:00 foo/bar a. [ a -eq 4 ] b. [ a != 4 ] c. [ 3 -eq 4 ]
a. bob can rename the file d. [ 3 = 4 ] e. [ a = 4 ]
b. pat can rename the file 80. Which of these statements is true?
c. pat can create a new file in the directory a. you can only remove a file name if the file is owned by you
d. bob can access and write on the file b. you can only make links to files owned by you
e. bob can list names in the directory c. you can change the permissions of any file to which you can write
73. User bob is in groups bg1 and bg2. User pat is in group pgg. d. you may be able to rename a file even if you do not own the file
d--xrwx--x 2 bob ted 60 Jan 1 1:00 foo e. you can only remove a file name if the file is writable by you
----rw--w- 1 bob bg1 0 Jan 1 1:00 foo/bar 81. What value to chmod would change the permissions on a file to r-----rw-?
a. bob can access and write on the file a. 322 b. 102 c. 122 d. 406 e. 654
b. bob can list names in the directory
c. bob can create a new file in the directory
d. pat can access and write on the file
e. pat can rename the file

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -13- 1 Minute Per Question 188 M/C Questions -14- 1 Minute Per Question

82. User bob is in groups bg1 and bg2. User pat is in group pgg. 89. How does system logging work under Unix/Linux?
d--x--xrw- 2 bob pgg 60 Jan 1 1:00 foo a. processes copy logs from your $HOME directory to the /var/spool directory
-r-xrwx-w- 1 bob bg2 0 Jan 1 1:00 foo/bar b. processes send messages to a central rsyslog program that writes log files
a. pat can rename the file c. processes send messages to the init process that inherits orphan processes
b. bob can create a new file in the directory d. processes write log files into each user’s $HOME directory
c. pat can access and write on the file e. processes write log entries directly into the system log directory
d. bob can list names in the directory 90. User bob is in groups bg1 and bg2. User pat is in group pgg.
e. bob can access and write on the file d-wx--x--x 2 bob ted 60 Jan 1 1:00 foo
83. What command would you use to see the command that at job number 2 will run? -r-xr-xrwx 1 pat bg2 0 Jan 1 1:00 foo/bar
a. at -c 2 b. atq 2 c. at -m 2 a. pat can rename the file
d. at -l 2 e. at -v 2 b. bob can list names in the directory
84. To change your own account password, type this into the shell prompt: c. bob can access and write on the file
a. $ passwd d. pat can access and write on the file
b. $ passwd idallen-ubuntu e. bob can create a new file in the directory
c. $ passwd . 91. User bob is in groups bg1 and bg2. User pat is in group pgg.
d. $ passwd cst8207 dr-xrwxrw- 2 pat pgg 60 Jan 1 1:00 foo
e. $ passwd * --w----r-x 1 bob bg1 0 Jan 1 1:00 foo/bar
85. When an at job runs, the current working directory is set to: a. bob can access and write on the file
a. the system ROOT directory b. pat can access and write on the file
b. the directory with the name /home c. pat can rename the file
c. the HOME directory of the user who created the job d. bob can create a new file in the directory
d. the directory with the name /root e. bob can list names in the directory
e. the current directory that was in use when the at job was created 92. Which of these outputs an error message on Standard Error?
86. What is the output on your screen of the following sequence of commands: a. echo 2>$1 'error' b. echo 2>&1 'error'
a=4 ; b=4 ; [ $a -le $b ] ; echo $? c. echo 1>&2 'error' d. echo 1>2 'error'
a. test: $a: integer expression expected e. echo 1>$2 'error'
b. 0 93. The octal mode of a directory that allows the user to access files and list the names
c. the number 1 or 0 followed by another 1 or 0 on a new line in it, but not to create any new files:
d. no output a. 400 b. 300 c. 500 d. 200 e. 100
e. 1 94. The difference between the system (root) crontab and all the user (personal)
87. User bob is in groups bg1 and bg2. User pat is in group pgg. crontabs is:
dr---wx--x 2 bob ted 60 Jan 1 1:00 foo a. the system crontab has the date and time in it
-r-xrwxrwx 1 pat bg1 0 Jan 1 1:00 foo/bar b. the personal crontab has the date and time in it
a. pat can rename the file c. the personal crontab only runs commands once
b. pat can access and write on the file d. the system crontab also has the userid in it
c. bob can create a new file in the directory e. the personal crontab also has the userid in it
d. bob can access and write on the file
e. bob can list names in the directory
88. What permissions are given to newdir after this command line:
umask 156 ; mkdir newdir
a. --xr-xrw- b. rw--w---x c. r-x--x---
d. rw--w---- e. r-x-w-rw-

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -15- 1 Minute Per Question 188 M/C Questions -16- 1 Minute Per Question

95. User bob is in groups bg1 and bg2. User pat is in group pgg. 101. User bob is in groups bg1 and bg2. User pat is in group pgg.
d--xrwx-wx 2 bob ted 60 Jan 1 1:00 foo dr-x----wx 2 pat ted 60 Jan 1 1:00 foo
-r-x-w-r-x 1 bob bg2 0 Jan 1 1:00 foo/bar -r-xr-xrwx 1 pat bg1 0 Jan 1 1:00 foo/bar
a. bob can create a new file in the directory a. pat can access and write on the file
b. pat can access and write on the file b. bob can create a new file in the directory
c. pat can rename the file c. bob can list names in the directory
d. bob can list names in the directory d. bob can access and write on the file
e. bob can access and write on the file e. pat can rename the file
96. To bring a background shell job into the foreground, type: 102. What command changes a user’s password?
a. bg b. [Ctrl-D] c. [Ctrl-Z] a. mkpasswd b. chpasswd c. passwd
d. fg e. kill %1 d. chsh e. password
97. What value umask gives a new file permissions r--r-----? 103. User bob is in groups bg1 and bg2. User pat is in group pgg.
a. 110 b. 446 c. 220 d. 337 e. 440 d--xr-x-w- 2 bob pgg 60 Jan 1 1:00 foo
98. User bob is in groups bg1 and bg2. User pat is in group pgg. --w----r-x 1 bob bg2 0 Jan 1 1:00 foo/bar
d-wx---rw- 2 bob ted 60 Jan 1 1:00 foo a. bob can create a new file in the directory
----rwxrwx 1 bob bg2 0 Jan 1 1:00 foo/bar b. pat can access and write on the file
a. pat can access and write on the file c. bob can access and write on the file
b. pat can rename the file d. bob can list names in the directory
c. bob can create a new file in the directory e. pat can rename the file
d. bob can list names in the directory 104. Inside a shell script, which expands to the name of the script itself?
e. bob can access and write on the file a. "$?" b. "$#" c. "$@" d. "$0" e. "$*"
99. If you have a file crontab.day of commands in crontab format, you could 105. What would be the output of the following command line:
submit that file to be your live crontab file by running which of the following echo a b c d | awk '{print $2}'
commands? a. a b b. b c. no output
a. crontab -l crontab.day d. c d e. $2
b. crontab < crontab.day 106. Which of these safely tests for a null (empty) first argument?
c. crontab -e crontab.day a. if [ $1 = '' ]
d. crontab > crontab.day b. if [ "$1" = '' ]
e. echo crontab.day | crond c. if [ "$1" -eq '/dev/null' ]
100. User bob is in groups bg1 and bg2. User pat is in group pgg. d. if [ $1 = "" ]
d-w---xr-- 2 pat ted 60 Jan 1 1:00 foo e. if [ "$1" -eq '' ]
-rwxrwxrwx 1 pat bg2 0 Jan 1 1:00 foo/bar 107. Which command line below does not show any lines from inside the file bat?
a. pat can access and write on the file a. ls bat b. less bat c. tail bat
b. bob can create a new file in the directory d. more bat e. head bat
c. bob can access and write on the file
d. bob can rename the file 108. User bob is in groups bg1 and bg2. User pat is in group pgg.
e. bob can list names in the directory d---rwx--x 2 pat pgg 60 Jan 1 1:00 foo
--w----rwx 1 bob bg1 0 Jan 1 1:00 foo/bar
a. pat can rename the file
b. bob can create a new file in the directory
c. pat can access and write on the file
d. bob can access and write on the file
e. bob can list names in the directory

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -17- 1 Minute Per Question 188 M/C Questions -18- 1 Minute Per Question

109. Given my directory containing a file, which octal permissions allow me to delete the 118. What would the following command do: at 2pm
file from the directory, but not append data to the file? a. read commands from stdin to be run every day at 2pm
a. Directory: 600 File: 300 b. Directory: 700 File: 500 b. read commands from stdin to be run once at 2pm
c. Directory: 600 File: 500 d. Directory: 500 File: 500 c. issue an error message
e. Directory: 700 File: 200 d. run the user’s crontab jobs every day at 2pm
110. Which of the following options for bash or sh might be useful for debugging a e. run the user’s crontab jobs at 2pm
shell script? 119. What command displays the kernel ring buffer of log messages:
a. -r b. -c c. -x d. -z e. -l a. psmine b. ps lxww c. crontab
111. Given this successful command line (note the dot argument): d. showall e. dmesg
cd /tmp ; mkdir dir ; cd dir ; chmod u-x . 120. If I mount sda1 on /one and sda2 on /two, how can I link the existing file
Which next command will execute without any "permission denied" errors? /one/foo to the new pathname /two/bar?
a. ls /tmp/dir b. ls . a. ln /one/foo /two/bar
c. ls /tmp/dir/.. d. ls /tmp/dir/. b. ln /two/bar /one/foo
e. ls .. c. ln /one/bar /two/foo
112. User bob is in groups bg1 and bg2. User pat is in group pgg. d. ln -s /two/bar /one/foo
dr-xrwx--x 2 pat pgg 60 Jan 1 1:00 foo e. ln -s /one/foo /two/bar
--w----r-x 1 bob bg2 0 Jan 1 1:00 foo/bar 121. The minimum permissions you need to move a file foo from directory a to
a. bob can list names in the directory directory b are:
b. pat can access and write on the file a. wx on a, wx on b, w on foo
c. pat can rename the file b. rwx on a, wx on b, none on foo
d. bob can access and write on the file c. wx on a, wx on b, none on foo
e. bob can create a new file in the directory d. wx on a, wx on b, r on foo
113. What value umask gives a new file permissions r--r-----? e. rwx on a, wx on b, rw on foo
a. 440 b. 220 c. 447 d. 326 e. 110 122. Which command removes adjacent duplicate lines from a file?
114. The cron system can run commands at most every a. uniq b. dup c. dupl
a. minute b. day c. hour d. unique e. duplicate
d. second e. millisecond 123. Which command usually goes in your .bash_profile file?
115. What value umask gives a new file permissions r--r-----? a. source ./.bashrc b. ./.bashrc source
a. 110 b. 446 c. 220 d. 226 e. 440 c. cat ./.bashrc d. source ./.bash_profile
116. Given the following, can user bird in group sesame copy ./foo to bar? e. ./.bash_profile source
drwxr-xrwx 2 root sesame 4096 Oct 7 14:00 . 124. If the line, exit 2
-r-xr-xr-x 1 bird sesame 123 Oct 4 14:05 foo is executed in a shell script, what is the result?
a. No, because the directory is not accessible to bird a. an invalid argument error message
b. No, because foo has no write permissions for bird b. termination after sleeping for 2 seconds
c. Yes; permissions don’t apply because bird owns foo c. the script breaks out of up to 2 levels of loops
d. No, because the directory has no write permissions for bird d. termination with an exit status of 2
e. Yes, because bird has read permissions on foo e. termination with an exit status of 0
117. In an empty directory, what is output on your screen by: 125. Given my directory containing a file, which octal permissions allow me to delete the
mkdir -p a/b/c 1/2/3 ; mv a/b/c 1/2 ; find . -name c file from the directory, but not append data to the file?
a. ./1/a/b/c b. ./1/2/c a. Directory: 100 File: 200 b. Directory: 300 File: 300
c. ./1/2/a/b/c d. ./1/2/b/c c. Directory: 300 File: 500 d. Directory: 100 File: 100
e. ./1/2/3/a/b/c e. Directory: 500 File: 400

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -19- 1 Minute Per Question 188 M/C Questions -20- 1 Minute Per Question

126. What permissions are given to newfile after this command line: 132. What is the output on your screen of the following sequence of commands:
umask 326 ; touch newfile x=ok ; y=ok ; [ x = y ]
a. r--r----- b. r--r-x--x c. -wx-w-r-x a. no output on screen
d. -wxr----- e. -wx-w-rw- b. 1
127. User bob is in groups bg1 and bg2. User pat is in group pgg. c. test: x: integer expression expected
dr-x-wx--- 2 pat bg1 60 Jan 1 1:00 foo d. 0
-rwxrwxr-x 1 pat ted 0 Jan 1 1:00 foo/bar e. bash: x: command not found
a. bob can list names in the directory 133. Which command line below does not show any lines from inside the file out?
b. pat can rename the file a. tail out b. sort out c. more out
c. bob can create a new file in the directory d. wc out e. head out
d. pat can create a new file in the directory 134. If the current directory contains 10 visible files and 5 visible sub-directories, what is
e. bob can access and write on the file the output on your screen of this command: ls -d */.
128. What is the output on your screen of the following sequence of commands: a. 15 pathnames
i=00 ; [ $i -eq 0 ] ; echo $? b. an error message because */. does not exist
a. test: $i: integer expression expected c. 5 directory names
b. 1 d. */.
c. no output e. no output
d. 0 135. The octal mode of a directory that allows the user to cd into it and list the names in
e. the number 0 or 1 followed by another 0 or 1 on a new line it, but not to create any new files:
129. Given the following, can user bird in group sesame rename ./foo to bar? a. 100 b. 400 c. 200 d. 300 e. 500
d----wx--- 2 root sesame 4096 Oct 7 14:00 . 136. User bob is in groups bg1 and bg2. User pat is in group pgg.
---------- 1 bird sesame 123 Oct 4 14:05 foo dr---wx--x 2 bob ted 60 Jan 1 1:00 foo
a. Yes, because bird’s group matches the group writable directory --w--w-r-x 1 bob bg2 0 Jan 1 1:00 foo/bar
b. No, because bird cannot read the directory a. bob can list names in the directory
c. No, because bird has no permissions on foo b. pat can access and write on the file
d. No, because the directory has no permissions for other users c. bob can access and write on the file
e. Yes; permissions don’t apply because bird owns foo d. pat can rename the file
130. Which test checks to see if the pathname is not an empty file (zero bytes)? e. bob can create a new file in the directory
a. test -e path b. test -s path c. test -x path 137. If browser=lynx then which one of the following case patterns will match this
d. test -z path e. test -n path statement: case "$browser" in
131. If a=123 and b=456 then what is the output of the following sequence of a. l?n? ) echo yes ;;
commands: if [ $a = $b ]; then echo $a ; fi b. [lynx] | [LYNX] ) echo yes ;;
a. test: a=123: integer expression expected c. @ ) echo yes ;;
b. test: $a: string expression expected d. ?lynx? ) echo yes ;;
c. no output e. (*ynx echo yes ;;
d. bash: 123: command not found 138. Which of the following would result in a "true" exit status?
e. 123 a. [ '00' -eq "0" ] b. [ 00 = 0 ]
c. [ '00' -ne "0" ] d. [ '00' = "0" ]
e. [ '00' != "00" ]
139. Which expands to the exit status of the previous command?
a. "$0" b. "$@" c. "$*" d. "$?" e. "$#"

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -21- 1 Minute Per Question 188 M/C Questions -22- 1 Minute Per Question

140. Given the following, can user bird in group sesame remove ./foo? 147. User bob is in groups bg1 and bg2. User pat is in group pgg.
drwxr-xrwx 2 root sesame 4096 Oct 7 14:00 . dr--r-x-w- 2 bob pgg 60 Jan 1 1:00 foo
-rwxrwxrwx 1 bird sesame 123 Oct 4 14:05 foo -rwxrwxr-x 1 bob bg2 0 Jan 1 1:00 foo/bar
a. Yes, because bird matches the writable other permissions a. bob can access and write on the file
b. Yes; permissions don’t apply because bird owns foo b. bob can list names in the directory
c. No, because the directory is not accessible to bird c. pat can rename the file
d. Yes, because bird has full permissions on foo d. pat can access and write on the file
e. No, because bird has no write permission on the directory e. bob can create a new file in the directory
141. The minimum permissions you need to link a file foo from directory a to 148. Which of the following, as first line of a shell script, would mean that when the
directory b are: script is run as a command, /bin/sh will be run with the -u option to process
a. rwx on a, wx on b, rw on foo the script.
b. x on a, wx on b, none on foo a. !#/bin/sh -u b. #!/bin/sh -u c. !/bin/sh -u
c. rwx on a, wx on b, none on foo d. #/bin/sh -u e. !!/bin/sh -u
d. wx on a, wx on b, w on foo 149. User bob is in groups bg1 and bg2. User pat is in group pgg.
e. wx on a, wx on b, r on foo d--x-wx--- 2 bob pgg 60 Jan 1 1:00 foo
142. Other than root, who can change the permissions of the following directory? -r-x-w-r-x 1 bob bg1 0 Jan 1 1:00 foo/bar
dr-xrwxrwx 17 foo bar 4096 Apr 15 16:40 . a. pat can rename the file
a. user foo and any user in group bar b. bob can list names in the directory
b. only users in group bar c. pat can access and write on the file
c. only user foo d. bob can access and write on the file
d. only root can change the permissions e. bob can create a new file in the directory
e. anyone except user foo 150. Which command displays all processes in a full wide listing?
143. User bob is in groups bg1 and bg2. User pat is in group pgg. a. ps zxvf b. ps -all -wide
d-w-rwx-wx 2 bob ted 60 Jan 1 1:00 foo c. ps -any -wide d. ps laxww
-r-xrwxrwx 1 pat bg2 0 Jan 1 1:00 foo/bar e. ps -full
a. bob can list names in the directory 151. What minimal permissions must you have on a directory to be able to execute
b. pat can rename the file successfully the command ls . from inside the directory?
c. bob can create a new file in the directory a. 300 b. 400 c. 600 d. 100 e. 500
d. bob can access and write on the file 152. Given the following, can user bird in group sesame copy ./foo to bar?
e. pat can access and write on the file drwxrw-r-x 2 root sesame 4096 Oct 7 14:00 .
144. What command line shows only your own processes, not all processes? -rwx-wx-wx 1 bird sesame 123 Oct 4 14:05 foo
a. crontab b. psmine c. ps lxww a. No, because the directory has no write permissions for others
d. dmesg e. showall b. No, because foo has no read permissions for bird
145. Inside a shell script, which expands to the number of script arguments? c. No, because the directory is not accessible to bird
a. "$#" b. "$?" c. "$@" d. "$*" e. "$0" d. Yes, because bird has write permissions on foo
146. Given my directory containing a file, which octal permissions allow me to access e. Yes; permissions don’t apply because bird owns foo
and append data to the file but not delete the file?
a. Directory: 200 File: 200 b. Directory: 400 File: 400
c. Directory: 100 File: 100 d. Directory: 600 File: 700
e. Directory: 100 File: 200

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -23- 1 Minute Per Question 188 M/C Questions -24- 1 Minute Per Question

153. User bob is in groups bg1 and bg2. User pat is in group pgg. 160. User bob is in groups bg1 and bg2. User pat is in group pgg.
d-wxrwx-w- 2 pat ted 60 Jan 1 1:00 foo d-wx-w-rwx 2 pat bg1 60 Jan 1 1:00 foo
-r-xr-xrwx 1 pat bg1 0 Jan 1 1:00 foo/bar -rwxrwxrwx 1 pat ted 0 Jan 1 1:00 foo/bar
a. bob can access and write on the file a. bob can create a new file in the directory
b. pat can rename the file b. pat can create a new file in the directory
c. bob can list names in the directory c. bob can access and write on the file
d. pat can access and write on the file d. bob can rename the file
e. bob can create a new file in the directory e. bob can list names in the directory
154. The signal sent to a foreground process by typing the [Ctrl-C] key is: 161. The minimum permissions you need to copy a file foo from directory a to
a. SIGINT b. SIGKILL c. SIGHUP directory b are:
d. SIGSTOP e. SIGTERM a. wx on a, wx on b, none on foo
155. Inside a shell script, which correctly expands to be the first script argument without b. rwx on a, wx on b, none on foo
processing any special characters in the argument? c. x on a, wx on b, r on foo
a. '$1' b. \$1 c. "\$1" d. wx on a, wx on b, rw on foo
d. "$1" e. $1 e. rx on a, wx on b, w on foo
156. Given the following, can user bird in group sesame append to ./foo? 162. User bob is in groups bg1 and bg2. User pat is in group pgg.
dr-xr-xr-x 2 root sesame 4096 Oct 7 14:00 . d-w---xr-x 2 pat ted 60 Jan 1 1:00 foo
-r-xrwxrwx 1 bird sesame 123 Oct 4 14:05 foo -rwxr-xrwx 1 pat bg2 0 Jan 1 1:00 foo/bar
a. No, because bird has no write permission on the directory a. bob can create a new file in the directory
b. No, because bird has no write permissions on foo b. bob can rename the file
c. No, because the directory is not accessible to bird c. pat can access and write on the file
d. No, because execute permissions are not set for bird on foo d. bob can access and write on the file
e. Yes; permissions don’t apply because bird owns foo e. bob can list names in the directory
157. Given the following, can user bird in group sesame append to ./foo? 163. If a shell script named foo contains the line:
dr-xr--r-x 2 root sesame 4096 Oct 7 14:00 . if [ '$3' = "$1" ] ; then echo SAME ; fi
-rw-rw-r-- 1 bird sesame 123 Oct 4 14:05 foo then which of the following command lines will produce SAME as output?
a. No, because execute permissions are not set for bird on foo a. ./foo bar bar b. ./foo "bar" 'bar'
b. Yes; permissions don’t apply because bird owns foo c. ./foo $3 $3 d. ./foo '$3' bar
c. No, because bird has no write permission on the directory e. ./foo "$1" '$3'
d. No, because the directory is not accessible to bird 164. What command displays the groups you are in?
e. Yes, because bird has write permissions on foo a. grouprint b. groups c. mkgroups
158. Under what directory are system configuration files usually stored? d. gpasswd e. lstgroups
a. /var/log/ b. /bin/ c. /etc 165. Which crontab line executes at 13:54 every day?
d. /log/var/ e. /usr/bin a. 13 54 * * * command b. 13 * * * 54 command
159. Which command line displays all the non-hidden names in the current directory that c. * * * 13 54 command d. 54 13 * * * command
contain the case-insensitive word hi (and no other names)? e. * * * 54 13 command
a. echo *[Hh][Ii]* b. echo *(H,h,I,i)* 166. The octal mode of a directory that allows the user to cd into it, but not to create any
c. echo ?[HhIiHhIi]? d. echo *[hiHI]* new files or to list any of the names in it:
e. echo ?[HhIi]? a. 500 b. 100 c. 300 d. 400 e. 200

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -25- 1 Minute Per Question 188 M/C Questions -26- 1 Minute Per Question

167. Given the following shell script statement, 173. What is the output of this command line in an empty directory:
if [ "a" = "b" ] ; then echo SAME ; fi touch .a .b .c ; echo [.]*
which of the following statements is true? a. no output
a. "[" is part of all "if" statements b. an error message from echo saying [.]* does not exist
b. "[" is passed four arguments c. [.]*
c. "fi" would cause a "command not found" error d. .a .b .c
d. an "invalid number" error would result e. . .. .a .b .c
e. "SAME" would be printed 174. What would be the output of the following command line:
168. User bob is in groups bg1 and bg2. User pat is in group pgg. echo a b c d | awk '{print $NF}'
dr-xr-xrwx 2 pat bg1 60 Jan 1 1:00 foo a. $NF b. d c. no output
-rwxrwxr-x 1 pat ted 0 Jan 1 1:00 foo/bar d. a b c d e. 4
a. bob can list names in the directory 175. The output of the whoami command is:
b. pat can create a new file in the directory a. your HOME directory
c. bob can rename the file b. your userid
d. pat can rename the file c. a list of users logged in to the system
e. bob can access and write on the file d. the current directory
169. Which command line would show the inode number of a file? e. a list of accounts in the password file
a. ls -l file b. cat -l file c. find -i file 176. Given my directory containing a file, which octal permissions allow me to access
d. ls -i file e. cat -i file and append data to the file but not delete the file?
170. Given my directory containing a file, which octal permissions allow me to access a. Directory: 600 File: 700 b. Directory: 500 File: 100
and append data to the file but not delete the file? c. Directory: 100 File: 600 d. Directory: 400 File: 400
a. Directory: 400 File: 400 b. Directory: 500 File: 600 e. Directory: 200 File: 200
c. Directory: 100 File: 100 d. Directory: 300 File: 200 177. A Unix/Linux "tarball" is:
e. Directory: 600 File: 700 a. a single-file that contains individual compressed files
171. Given the following, can user bird in group sesame append to foobar? b. a multi-file directory containing individual compressed files
drwxrw-rwx 2 root sesame 4096 Oct 7 14:00 . c. a single-file that contains individual uncompressed files
-rw-rw-r-- 1 bird sesame 1024 Oct 4 14:05 foobar d. a multi-file directory containing individual uncompressed files
a. No, because execute permissions are not set for bird on foobar e. a single compressed file containing one uncompressed file
b. Yes, because bird owns foobar 178. Which of these commands makes a file owned by me, also readable by me?
c. Yes, because bird has write permissions on foobar a. chmod r=u ./myfile b. umask 300 ./myfile
d. No, because the directory is not accessible to bird c. chmod r+u myfile d. umask 400 myfile
e. Yes, because sesame has write permissions on foobar e. chmod u+r ./myfile
172. Which command line makes a directory dir into which anyone can put a file, but
179. User bob is in groups bg1 and bg2. User pat is in group pgg.
in which nobody can see the names of the files that are there?
dr-x-wx--x 2 bob ted 60 Jan 1 1:00 foo
a. mkdir dir ; chmod 222 dir -r-xr-xrwx 1 pat bg1 0 Jan 1 1:00 foo/bar
b. mkdir dir ; cd dir ; chmod ugo=w . a. bob can list names in the directory
c. mkdir dir ; cd dir ; chmod ugo-rw . b. bob can access and write on the file
d. mkdir dir ; chmod 333 dir c. pat can rename the file
e. mkdir dir ; chmod 333 . d. pat can access and write on the file
e. bob can create a new file in the directory

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
188 M/C Questions -27- 1 Minute Per Question 188 M/C Questions -28- 1 Minute Per Question

180. User bob is in groups bg1 and bg2. User pat is in group pgg. 186. In a directory containing one file named dog, what is the output on your screen
drw-r-xrwx 2 pat bg1 60 Jan 1 1:00 foo after this command line: 2>/dev/null ls nosuchfile
-rwxrwxr-x 1 pat ted 0 Jan 1 1:00 foo/bar a. no output
a. bob can rename the file b. ls: nosuchfile: No such file or directory
b. bob can access and write on the file c. dog
c. bob can list names in the directory d. bash: 2>/dev/null: command not found
d. pat can create a new file in the directory e. nosuchfile
e. pat can rename the file 187. What does the -v option to the fgrep command do?
181. In an empty directory, what is output on your screen by: a. prints the version number of the fgrep command
mkdir -p a/b/c 1/2/3 ; mv a/b 1/2 ; find . -name c b. turns on the translation of unprintable characters
a. ./1/2/a/b b. ./1/2/b/c c. ./1/a/b c. selects lines that do not contain a match for the supplied pattern
d. ./a/b/c e. ./1/2/c d. selects lines that do not contain unprintable characters
182. To show all your one-time scheduled commands, type: e. turns off the translation of unprintable characters
a. crontab -l b. /etc/crontab 188. Did you read all the words of the test instructions on page one?
c. /var/log/crontab d. atq a. 132 b. 231 c. 123 d. 321 e. 312
e. cat crontab
183. User bob is in groups bg1 and bg2. User pat is in group pgg.
d--x-----x 2 pat pgg 60 Jan 1 1:00 foo
-r-xrwx-w- 1 bob bg1 0 Jan 1 1:00 foo/bar
a. pat can access and write on the file
b. bob can list names in the directory
c. bob can create a new file in the directory
d. pat can rename the file
e. bob can access and write on the file
184. The minimum permissions you need to delete a file foo from directory a are:
a. wx on a, r on foo b. rwx on a, rw on foo
c. wx on a, w on foo d. rwx on a, none on foo
e. wx on a, none on foo
185. User bob is in groups bg1 and bg2. User pat is in group pgg.
d--xr----x 2 bob ted 60 Jan 1 1:00 foo
-r-x-w-rwx 1 pat bg2 0 Jan 1 1:00 foo/bar
a. bob can create a new file in the directory
b. bob can access and write on the file
c. pat can rename the file
d. bob can list names in the directory
e. pat can access and write on the file

CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question CST 8207 − For 2019 − Practice Test #3 − 40% Ian! D. Allen 1 Minute Per Question
CST8207-19W - Ian Allen - Practice Test #3 - Test Version DABBAD

1b 33 b 65 e 96 d 127 c 158 c
2d 34 b 66 b 97 d 128 d 159 a
3d 35 c 67 c 98 c 129 a 160 b
4e 36 e 68 c 99 b 130 b 161 c
5d 37 c 69 a 100 e 131 c 162 e
6e 38 c 70 b 101 b 132 a 163 d
7c 39 e 71 c 102 c 133 d 164 b
8a 40 b 72 a 103 c 134 c 165 d
9a 41 a 73 d 104 d 135 e 166 b
10 c 42 a 74 e 105 b 136 a 167 b
11 d 43 c 75 c 106 b 137 a 168 a
12 b 44 c 76 b 107 a 138 a 169 d
13 d 45 e 77 e 108 d 139 d 170 b
14 c 46 b 78 d 109 b 140 e 171 d
15 b 47 e 79 a 110 c 141 b 172 d
16 b 48 a 80 d 111 a 142 c 173 c
17 b 49 b 81 d 112 d 143 b 174 b
18 c 50 b 82 c 113 d 144 c 175 b
19 e 51 a 83 a 114 a 145 a 176 c
20 e 52 c 84 a 115 d 146 e 177 c
21 c 53 a 85 e 116 d 147 b 178 e
22 c 54 a 86 b 117 b 148 b 179 a
23 d 55 c 87 e 118 b 149 a 180 c
24 c 56 e 88 b 119 e 150 d 181 b
25 b 57 a 89 b 120 e 151 e 182 d
26 e 58 d 90 e 121 c 152 c 183 a
27 a 59 d 91 e 122 a 153 b 184 e
28 c 60 b 92 c 123 a 154 a 185 b
29 b 61 c 93 c 124 d 155 d 186 a
30 e 62 c 94 d 125 c 156 b 187 c
31 d 63 c 95 c 126 a 157 d 188 c
32 a 64 b

You might also like