Shell File Patterns
Due: Wednesday January 6, 1999
Hand in your output before you go home today.
Purpose:
Develop skills using Unix tools.
Assignment:
Start in this directory: ~ian/set7
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.)
- 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?
- What is the shortest command you can type to enter the sub-directory that is under the ~ian/set7
directory?
Go into the sub-directory that is under the directory ~ian/set7 and
answer these questions:
- There are more than 50 files and/or directories in this sub-directory.
Use Unix commands to count exactly how many.
- How many of the entries here are directories?
Use Unix commands to count exactly how many.
- How many files are compressed files?
Use Unix commands to count exactly how many.
- 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.
Hand In:
On paper, submit the cut-and-paste output of the command lines you used and the output
they generated.
Additional material:
Based on material from Chapters 3 through 5 of the Unix System text.
See also the section on Unix in this page:
http://www.hotwired.com/webmonkey/backend/backend_more.html
"On the résumé that convinced HotWired to hire
me, I said that I knew enough about Unix that it didn't scare me anymore. This wasn't
exactly true. Unix was still a chilling concept for me when I arrived at the San Francisco
office armed with a copy of Unix for Dummies. The managing editor steered
me to my desk and instead of the Macintosh I was hoping for, there sat a purple SGI."