Homework 10: Look how fast you are now!

Due Monday, April 16, by 10:30 AM


As usual, place the commands you used to solve each of the 5 problems into a file called homework10. This is intended as practice, since this week's lecture topic is not really well-suited to a matching homework assignment.
  1. The "uptime" program determines how long a computer is running. Show the time isoptera has been running, but this time use "pretty" format.
  2. The "uptime" program obtains the system uptime from a file in /proc named "uptime". Use sleep and cat to print out this file twice, one second apart. Remember, you can use the semicolon ; to separate multiple commands that will be run in sequence on the same line. Is the first, or the second number in the contents of uptime in seconds?
  3. /proc/crypto contains a list of cryptography algorithms supported by the kernel. How many of these are there?
  4. Produce a list of just the names of the cryptography algorithms, with no other text like "name" or ":". Note that there are a couple repeats. If you look at the details, they are different in some way, but since they have the name, eliminate the duplicates from your list. This is a natural fit for grep, cut, sort, and uniq, but feel free to use whatever you like.
  5. The program "sensors" gives a list of temperatures for each CPU core, and sometimes other hardware as well depending on the system and installed drivers. Make a nice looking list like the following:

    48.0°C 41.0°C 48.0°C 42.0°C 40.0°C 44.0°C 45.0°C 39.0°C 42.0°C 39.0°C 39.0°C 39.0°C 41.0°C
    46.0°C 45.0°C 46.0°C 44.0°C 44.0°C 45.0°C 44.0°C 44.0°C 37.0°C 35.0°C 38.0°C 41.0°C 39.0°C

    cut and grep will work for the most part, but at the end, pipe your list into the program named column. Don't fear the degree symbol, even though you can't type it (at least not easily!).
Turn in your homework by creating a file named "homework10" with no extension in your home directory, with permissions set so that only you can view the file. This assignment is worth 35 points, 5 from correct naming, 5 from correct permissions, and 5 from each of the problems above. As a reminder, you can set the permissions correctly with this line:
chmod 600 homework10