CS257 Assignment: Unix Scavenger Hunt

Due at class time Friday, 4/4/03. Submit on paper. Brief answers are desirable. Provide appropriate citations.

You may discuss this with classmates, but each of you should hand in your own answers. Don't spoil the experience by giving each other complete answers, but go ahead and offer obscure hints if you feel like it. If somebody's obscure hint leads you to an answer, cite (or blame, if you prefer) the hinter.

There are a bunch of questions that start with "What command or combination of commands would you use to...". Try to answer these with commands that fit on a single line without semi-colons.

  1. Is it spelled UNIX or Unix? On whose authority?

  2. What is "System V"?

  3. What's the relationship between Unix and POSIX?

  4. What is the etymology of the name of the tac command?

  5. What command or combination of commands would you use to remove all the carriage returns from file.txt?

  6. What command or combination of commands would you use to change all linefeeds to CRLF pairs (carriage-return followed by linefeed). Why would you want to?

  7. Suppose you have a text file columns.txt that consists of lines with five tab-delimited columns. What command or combination of commands would you use to print out a sorted list of the second columns of all the lines?

  8. What command or combination of commands would you use to print the full columns.txt lines, sorted by their second columns?

  9. What command or combination of commands would you use to count the number of blank lines in the file file.txt?

  10. What command or combination of commands would you use to copy the contents of the Google home page to a file called google.html.

  11. What command or combination of commands would you use to count how many files in your account have names that contain the string "moose", regardless of case. (Thus, if you have smoose.txt and schmOoSe.txt, they should both be counted.)

  12. Count the moose files again, but this time, your command output should be the square of the number of moose files. Don't ask me why one would want to square the number of moose files--just do it.





Jeff Ondich, Department of Mathematics and Computer Science, Carleton College, Northfield, MN 55057, (507) 646-4364, jondich@carleton.edu