Week 6 Homework

Ratings: 1 Star2 Stars3 Stars4 Stars5 Stars (5.00 out of 5) - Rate Now!
Loading...

Download Category:

Week 6 Homework.zip - (133.3 KB)
[
Week 6 Homework/Question.txt
Week 6 Homework/Screenshot_1.png
Week 6 Homework/Screenshot_2.png
Week 6 Homework/Week 6 Homework.docx
]

CS 345 Week 6 Homework

1 – 5) Finally! You get to prove your scripting skills since I know you’ve been chomping at the bit to do so. I would like you to create a script called tell that when run, does a variety of tasks:

A) You will need to use loop across each user that is currently logged in on the system.
B) For each user logged in, you will print information out about the user: their login name, real name, where they are logged in from, how long they have been logged in and where their home directory is located. You can mostly get this information from the who and finger commands that we talked about way back in week one.
C) Next we want to print out the amount of diskspace that a particular user is consuming in his/her home directory with files. Print out each file and its size in K, and then at the end print out a grand total of diskspace used in K as well. Your friends find and du will serve you well in this effort.
D) Print out whatever processes are owned by the user. With a little bit of help from man you can create the cascading print to show nested processes like what I am showing in my output.
E) Finally, consulting top would let you determine how much CPU time and memory the user is consuming. Print that information out in a nice concise format.

Hints:
A) You may need to use the cut command to remove extraneous punctuation or ends of lines. You’ll want to read up on this command in man and try it outside of the script to see how it works.
B) You’ll find the awk command useful for printing out a specific column of output from a command that returns multiple columns. For example piping some output to awk in the form of command | awk ’{print $4}’ would print out the fourth column of information that the command generated.
C) The awk command can also be told to count and print when done counting as in command | awk ‘{ cnt = cnt+$1 } END {print “Count is : “,cnt}’

6) Write a script file to check for SetUID programs 4755.

7) Create a text file and make it a SetUID program.

8) Prove your script file works.

9) Use at to run your script 3 minutes from now.

10) Show how to run your script every night at 12:34 in the morning via cron.

11) Explain the purpose of a print filter and compare it to the idea of Windows printer drivers.

12) What does a printcap file contain?

13) How would you shut down a print queue that’s gone awry?

14) Show an example of a how a user can delete their own print jobs.

15) Are print quotas necessary? Why or why not?

Get a fresh solution of this question. Ask it now to our experts.
doubt

Ask Your Question

We have verified professionals who are ready to answer your question.

time

Save Time and Money

We choose experts who can quickly answer your question and that suit your budget.

download

Get Your Answer

Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.