Lab/Homework 2
- Consider the body of text that makes up the World Wide Web with respect to
the four qualities that
McEnery and Wilson ascribe to corpora in Chapter 2.
- Is it representative? If yes: how so? If not: why not?
- Is it of finite size? If not, what term could
be used to describe it?
- Is it in machine-readable form?
- Could it be considered a standard reference? If yes: how
so? If not: why not?
- Use the
ls command to find what appears to be
the oldest directory in /home. Show me
exactly what you typed, and give me all of the information
on the oldest directory. Hints:
- There are 116 directories in
/home, so you want to
take advantage of ls's switches to do this for you,
rather than trying to figure it out manually. Is there a switch
that will sort ls's output by age?
- Go to the directory
/corpora/celex/english, using either
relative or absolute addressing. Use the pwd command to
demonstrate that you got there. Show me exactly what you typed, and
exactly what the output was.
- Go to your home directory. Go to the directory
/corpora/celex/english
by using the absolute path. Show me exactly what you typed to get there. Hint:
it will start with cd.
- Go to your home directory. Use the absolute path to put a copy of the
file
/corpora/celex/english/README in your home directory.
Show me exactly what you typed.
- Open
emacs. Spend 15 minutes working on the tutorial. When you've done this, write I have spent 15 minutes working on the emacs tutorial.
- In your copy of the README file, use emacs to change the word Corpus
to Stuff. Save it.
- Use the
diff command to find all differences between your
copy of the README file, and the original version of that file in
/corpora/celex/english. Show me exactly what you typed,
and show me the output. Hints:
- Your book gives a good description of how
diff works.
- You're in your home directory, so you'll need to use the absolute
path to the original version of the README file.
- Why shouldn't you use a real word as a password?
- Create a directory that your partner can view the contents of, but cannot cd into. Show me the permissions for this directory. (Assumption: you and your partner both belong to the group
student. Hints: mkdir chmod)
- What is the size, in bytes, of the file /corpora/celex/english/README?
- Use the head and tail commands and the pipe operator to display the fifth line of the file /corpora/celex/english/README. Show me what you typed to produce the output. (Hint: you're trying to get the following output:
epl English Phonology, Lemmas
- Use head, tail, wc, the pipe operator, and the redirect operator to create a file named "junk" that contains a count of the number of words on the fifth line of /corpora/celex/english/README. Show me what you typed. (Hint: there are four words. Don't worry about the extra spaces.)
- Use head, tail, wc, the pipe operator, and the append operator to add the fifth line of the README file to the junk file that you created in the last step. Show me what you typed. (Hint: your file should contain 2 lines. The first one has the number 4 (and some extra spaces in it). The second line says
epl English Phonology, Lemmas. Don't worry about the extra spaces.)
- Copy the file /home/kev/helloWorld.pl into your home directory. Check its permissions. What are they?
- Try to execute the file. (You do this by typing
rehash[ENTER] and then typing helloWorld.pl.) What happens?
- Change the permissions of the file so that it is now executable by you *and only by you*. What are the permissions now?
- Try to execute it (see above). What happens?