Problems 2
Home Up Review Problems 1 Problems 2 Problems 3 Problems 4 Problems 5 Problems 6 Problems 7 Problems 8 Problems 9 Problems 10 Problems 11 Problems 12 Problems 13 Problems 14 Problems 15 Problems 16 Subnets

 

Shell File Patterns

Start in this directory: ~ian/lab2

Answer these questions. Give the Unix command lines you used to arrive at your answers. (Cut and paste will work nicely to show your commands and their output.)

  1. This directory contains a bunch of things that are all the same size and have similar names. Which one is a directory? How can you tell?
  2. What is the shortest command you can type to enter the sub-directory that is under the lab2 directory?

Go into the sub-directory that is under the directory  ~ian/lab2 and answer these questions:

  1. There are more than 50 files and/or directories in this sub-directory.
    Use Unix commands to count exactly how many.
  2. How many of the entries here are directories?
    Use Unix commands to count exactly how many.
  3. How many files are compressed files?
    Use Unix commands to count exactly how many.
  4. The "sum" command ("man sum") produces a number based on the content of a file. While not guaranteed to be true for every file, the number is always the same if the file content is the same, and usually different if the file content is different. (Rarely, different content can produce the same number.)

    Many of the files in this directory contain the same content. Use Unix commands to find out which files are the same and which are different. How many different files are there, really? (You may need to uncompress some files to answer this question.)

    Use a Unix command to locate the differences among the files that are different. Cut-and-paste just the differences.