Due: Friday, April 9, 2:30 pm, by email.
The purpose of this homework is to get you acquainted with the Unix shell, including (1) learning to use the Unix help system; (2) familiarity with using common commands; (3) some idea of how you might use these tools in everyday programming.
Write your answers in a plain Unix text file and send it in the
body of an email message to Charlie
with a subject that begins with the string: 490c-hw1
.
Make sure you indicate clearly which answer goes
to which question.
You should write your answer to this homework alone. However,
feel free to consult with your friends about Unix in general. A
great deal of Unix culture has always been transmitted orally. On
the other hand, you should not just ask your friend for
the answer to any question! So, for example, it is acceptable to
ask: "Do you know what command can do foo?" To which
your friend may reply: "Do 'man foobar'". Your friend
may not answer: "The answer to question 7 is foobar -f -n -q
-X:!{#}.
".
We'll start with creating a place to work. What commands could you use to do the following tasks?
To get some interesting data to work with, we'll use a command called wget, which can download files from the Web.
What command could you use to view the contents of this file, excluding any lines that contain the words "garbage" or "junk"?
What command could you use to replace every occurence of "big" with "large" when viewing the file, while also excluding lines with "garbage" and "junk"? (Be sure to replace all the occurrences of "big"!)
It's often convenient to create compressed archives of files, either for copying or backup. A common way to do this is with tar and gzip. Show the commands you could use to:
Ok, no point in having identical files lying around. How could you use rm to remove anotherFile.txt and sampleFiles2.tar.gz, but have it prompt you for confirmation first?
Now for something a little more realistic! Unix is built for programmers, so let's see how some of these commands could be useful in programming tasks. For this problem, turn in the series of commands you used to accomplish each part.
Note: keep these files around, since we'll use them for Homework 2 as well.
Finally, let's customize your shell. You can use either tcsh or bash; just say which one you used. For this problem, submit the changes you make to your .cshrc or .bash_profile files.
Side note for the curious: If you want to try to compile and play with the jEdit source and you're logged into attu, go to the jEdit directory and run ant dist. (Ant is a build tool in /uns/bin, sort of like make.) You can run your newly compiled jar file with java -jar jedit.jar.