Answer the following questions and write out the exact command(s) you used (100 points)
A. 25 points
2. List only the dot files in your homedirectory and recursively list the directories starting with a dot.
3. Use the command file with the option -f to display the types of the files in your home directory with a one line command.
4. What is the PID of your login shell? Explain in detail your choice of a number from the output of the command ps.
5. Create a file that contains the process numbers
associated with at least two jobs arranged in descending order.
example contents of output file:
2930
2928
B. 75 points
1. Write a script which will write your username, your homedirectory, the type of terminal and the printer that lp uses, so that the output looks like
Your username is chris
Home directory is /cs/ugrad/chris
You are using a terminal which is a vt100
The default lineprinter is cs/p1.
2. Write a script which finds the oldest file in your home directory and prints name and the size of file on the screen preceded by the message
The name and size of file are:
xyz 475
3. List names of files in your home directory which
4. Use the commands ps, kill, jobs,
fg, bg, grep
5. Redirections and commands cat,
wc, tail, head.
Extra Credit:
(15 points)
Explain in detail what the following 2 commands do
echo baz 2>"foo" >&2
echo baz >&2 2> "foo"
*Some of the questions above have been authored by Regis VIncent