Assignment 2

A Moving Experience

Assigned
Due

Aug 31
30 pts
Sep 14

Here is a small task to practice moving files around. This is an exercise; not a particularly useful task, though it should help practice some useful skills.

  1. Copy the source code for the pure ftpd server. (This is just a quick way to get a bunch of files; we're not going to build the software.)
  2. Download the code from the distribution site. You can download through your browser in the usual way, or from the Unix shell with the command
    wget https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.47.tar.gz
  3. Store the file pure-ftpd-1.0.47.tar.gz in your home directory. This is a gzipped tar file, analogous to a zip file, but with some rather important internal differences.
  4. Go to your home directory and unpack the distribution with this command:
    tar zfx pure-ftpd-1.0.47.tar.gz
  5. You should now have a directory pure-ftpd-1.0.47 inside your home directory.
  6. Delete (remove) all the files named Makefile or with names starting with Makefile. There are several (lots of Makefile.am and Makefile.in) at different levels.
  7. Create another directory in your home area. You may call it anything you like, but I'll call it collect rather than having to be vague for the rest of the instructions.
  8. Inside collect, create a directory READMEs. From the pure ftp source directory, move all files whose names begin with README into collect/READMEs. Most are in the top level of the tree. A few are one directory level down. For those, move them and rename them with the their directory name as a prefix. For instance, foo/README.wombats would be become foo_README.wombats inside the collect/READMEs directory.
  9. For every other file anywhere in the pure ftpd directory which has an extension (which contains a dot, like dynamic.c, but not FAQ), create a directory under pure named after the extension, and move the file into it. That is, for dynamic.c, create a directory collect/c if it does not already exist, and move the file dynamic.c into it. So under collect, you should have directories names c, h, in, conf, and several others.
  10. Create one more directory under collect called misc and move any remaining files there. Leave all directories in place. (If you accidently move a directory, you can always just move it back. I'll never know.)
  11. You should be left with a tree of directories, all empty except for other directories.
  12. Go to your home directory (where pureftp and collect reside) and execute this command:
    ls -lR pure-ftpd-1.0.47 collect > listing.txt
    This will create a file called listing.txt. Send it to me here. (If you used a name other than collect for you new directory, use that name in the command instead.)

Don't forget that you can do things like ls */*.c to list all the .c files one level down. Also useful for mv and such.

One hint: When moving files around, you you might find it useful to open two shell windows, one in the pureftp directory, and one in collect. If you're using an installation with a GUI, just open the two windows. If you're comming from Windows, run two putty windows and connect twice. Likewise, coming from a Mac, run two command shell windows and connect each one.