IT244: Introduction to Linux/UNIX – Fall 2010 Homework 4

advertisement
IT244: Introduction to Linux/UNIX – Fall 2010
Homework 4
Due: Monday, 10/25/2010
Chapter 5:
NOTE: Remember to go to the man pages or look online in order to find
some of the answers. The book is vague on some of these issues.
Page 143
1) (10 points) Q. 1.
 This has to do with process startup, as discussed in this
chapter.
2) (10 points) Q. 2.
 Rewrite the given set of commands so that there are no
temporary files used. Do the same for the following set of
commands.
ps -ef > temp1
grep root temp1 > temp2
sort temp2
rm temp1 temp2
3) (10 points) Q. 4.
Page 145
4) (10 points) Q. 11.
 Try doing this on the system. You will see what happens,
and you can figure out how to fix it. Then tell me what you
found.
5) (10 points) Q. 16.
 In this question, imagine having created a file named
answer which is populated with some text. Also, the
question is not asking for you to give another command, but
to tell what the usual way for presenting the given
command would be.
1
6) (10 points) Describe the difference between built-in and nonbuilt-in commands, and tell me why one is faster to run that the
other.
7) (10 points) If a command called mycommand always puts data
out to both standard output and standard error, give me a
command line that would run mycommand and redirect both
standard out and error to a file called myoutput.
8) (10 points) What does the tee command do that no other
command does? How could this be useful to an administrator?
9) (10 points) Extra Credit
 Tell me what the result will be from giving the following set
of commands:
i. set –o noclobber
ii. echo “Hello” > output.txt
iii. cat output.txt > output2.txt
iv. echo “Hello again” > output2.txt
v. echo “Goodbye” >| output.txt
2
Download