Contents


Exercise: Unix Tools

  1. Installation:
    1. How many packages are installed on you machine (the command wc helps counting)?
    2. How much disk space is left/used on your machine?
    3. What directory under your home directory is using most disk space?

  2. Terminal Tools:
    1. Make a copy of one of the files in you home directory and try diff on the original and that copy.
    2. Add you name as an alias and invent some functionality for it.
    3. Search for you name in all files in you home directory and in all sub-directories.

  3. Cron:
      Use cron to:
    1. Write the current date and time in a file called "data" in you home directory and update it every minute.
    2. Write an email-message to yourself every minute that keeps you informed about the current local time in La Habana (Havana, Capital of Cuba).

  4. Regular Expressions:
    1. Create a test text-file with one line containing you name
      and some other lines with names that are similar.
    2. Write a regular expressions that matches your name
      (so that the output of the grep command applied to the test fils is only your name).
    3. Write a regular expressions that matches about half of the names in the file.
    4. Can you write a regular expressions that matches everything but your name? Why not ? What does the term "regular" mean?

  5. Math Tools:
    1. Try bc, octave, maple, matlab and mathematica (if installed) on the question:
      "What is 7777 divided by 17 ?"

  6. Compression and Archiving:
    1. Make a directory tmp under you home directory and copy
      all files from you home directory that begin with a "." to tmp.
    2. Create an archive of the tmp directory, then gzip the archive.
    3. Now create a test directory and un-zip and un-tar the archive in that directory.

  7. X:
    1. Draw a picture, save it as gif and jpeg and look at it with xv.
    2. Convert the picture into postscript (ps) and look at it with ghostview (gv).
    3. Compare the sizes of the three picture files in the different formats.
    4. Open the application xcalc on the monitor of you neighbor
      (you might have to ask him for collaboration to get the access rights).