SPR720 Midterm Practice

From CDOT Wiki
Jump to: navigation, search

Feel free to add additional questions! Discuss the answers on the "discussion" tab (above).

1) What does bash stand for?

a) Beginner's All-purpose Symbolic Helper
b) Borne Again Shell
c) Berkeley Associated Stdio Heurstics
d) Binary Assistive Shell

2) What is the difference between the /bin and /usr/bin directions and the /sbin and /usr/sbin directories?

a) /bin and /usr/bin contain binaries useful to all users, /sbin and /usr/sbin contain binaries useful to system administrators
b) /bin and /usr/bin contain large binaries, /sbin and /usr/sbin contain small binaries
c) only the superuser can use the program ins /sbin and /user/sbin; everyone can use the binaries in /bin and /user/bin
d) these directories are equivalent

3) This script is run:

#!/bin/bash
for X in LUX Seneca FSOSS LINUX 
do 
  if echo $X|grep -q X
  then 
    echo -n $X
  fi
done

What is the output?

a) LUXLINUX
b) LUX Seneca FSOSS LINUX
c) SenecaFSOSS
d) LUXSenecaFSOSSLINUX

4) This script is run:

#!/bin/bash
A="003"
B="3"
if [ "$A" = "$B" ]
  then echo "true"
  else echo "false"
fi

What is the output?

a) true
b) false
c) truefalse
d) (no output)

5) This script is run :

#!/bin/bash
ls /tmp/x /rhgb2 >a 2>b

What will be the contents of the files a and b?

a) a contains error messages, b contains non-error messages
b) b contains error messages, a contains non-error messages
c) a contains all messages and b is empty
d) b contains all messages and a is empty

6) When the command make is run, a message appears saying that there is “nothing to do”. Why?

a) there is no makefile
b) the makefile targets have a timestamp later than the source files
c) the makefile targets have a timestamp earlier than the source files
d) this message would never appear

7) What permission would be set on the file “foo” by this command?

chmod 751 foo
a) ----w-rw-
b) rwxr-x--x
c) r-xr-w---
d) rwx-w-r-x

8) A directory has the permission: --x--x--x You can:

a) list files in that directory but not use them
b) use files in that directory if you know the exact filename
c) not use or see any files in that directory
d) delete things in that directory

9) What will this command do?

rpm -qf /usr/share/sounds/phone.wav
a) display all packages which use that file
b) display the package which installed that file
c) display the package which have a dependency on that file
d) verify that that file has not change since it was installed

10) A package is named:

nled-2.52-3.fc8

What is the package release?

a) 2.52
b) 8
c) 3
d) not specified