1) Which of the following commands will search the help system for help on file permissions?
a. help permissions
b. man –k permissions
c. find –name permissions
d. less permissions
e. None of the above
2) Which of the following is an example of a relative pathname?
a. /home/student/tmp.txt
b. ./bin/run.bash
c. ../work/hello.py
d. Both b & c
e. None of the above
3) How would you remove a directory called work from your current working directory?
a. rm work
b. del work
c. rmdir work
d. mv work /dev/null
e. None of the above
4) Which of the following would you use to display the contents of a large text file called essay.txt?
a. cat essay.txt
b. more essay.txt
c. vi essay.txt
d. Any of the above
e. None of the above
5) What would be an example of output you might see from running the command: wc essay.txt
a. 4 22 142 essay.txt
b. 4 lines
c. The wc is in the main hall.
d. -rwxr-xr-x 2 dharter None 0 Nov 2 09:07 essay.txt
e. None of the above
6) How would you list all of the files in your current directory, or any directory beneath your current one, that are python script files (e.g. end with a .py file extension)
a. ls *.py
b. ls –a *.py
c. find . –name *.py –print
d. search . *.py
e. None of the above
7) Enter a command to search for the string SOCKET in all of the perl files in your current directory (e.g. those that end with file extension .pl), and that have file names with the word server in them:
$
8) Which of the following commands will successfully display all of the c source code files in your directory, sorted by the number of lines of code:
a. wc *.c | sort -n
b. cat *.c | ls
c. ls *.c | wc -s
d. sort *.c
e. None of the above
9) What steps do you need to perform in order to cause the contents of a file to be executed in the Unix environment:
a. Set the files execute permissions to be true using the chmod command
b. Add the the directory where the file resides to your PATH environment variable
c. Refer to the command using its absolute path name in order to execute it
d. Both (a) and (b)
e. Both (a) and (c)
f. Either (a) and (b) or (a) and (c)
10) Write a function, in either Perl or Python (your choice) that accepts 3 numbers as parameters and returns the minimum of the 3 integers as its result: