CS 2204 Lab 8

Your name here (please print):

Your student ID number here:

  1. (1 points) Run the command xclock in a nice mode, priority +19 in the background.

     

     

    nice -n 19 xclock &
  2. (1 point) Show the command line that helps you figure out exactly how long does command sleep 8 runs on your machine (the answer it has nothing to do with xclock ).

     

     

    time sleep 8
  3. (4 points) Write a command line that kills the processes (in the current shell/terminal) that have "NIceness" of 19. You may find ps -l useful. If you do everything right, the xclock should get killed. What happens if you kill all processes with niceness of 0? Explain.

     

     

     

    kill `ps -l | gawk '{ if ($8==19) print $4}'`
    My ps, gawk, and the shell itself are running at nice 0, and the kill may kill them. Usually the processes end up killing themselves (suicide) before killing the shell.
  4. (2 points) Show a command line that will email a class reminder to yourself on Monday April 3 2006 at 9.15 am.

     

     

    echo "echo \"class reminder\" | mail lallysingh@mac.com" | at 9:15am Apr 3
  5. (3 points) Write a line that you would include in a crontab file to send your friend john@yahoo.com a happy birthday email every March 16th.

     

     

    0 0 16 3 * echo "happy birthday" | john@yahoo.com