Assignment 1: Files and Directories
Due: June 16
To gain experience creating files and directories on the Unix command line,
and to work with the Vim text editor.
You should have completed weeks one through four before attempting to complete
This assignment requires you to have completed weeks one through four of the
course. You will follow the instructions below to create and modify a set of
files using the tools you learned thus far.
- Create a directory for this assignment called "assignment1" in your home directory.
- Create a file in the "assignment1" directory called "planets.txt" with Vim.
- Inside this file, put the names of the planets: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto.
Place each one on a line of its own, with no extra spaces or punctuation.
- Download this words file into the "assignment1"
directory (with the wget command). This file contains over 99,000 English
- Using Vim substitutions on the "words" file, we will make some changes to English orthography:
Each of these changes should be done on lower-case letters only. Don't worry about
doing substitutions on upper-case ones. Also, be sure to catch multiple instances
on the same line.
- Replace all instances of "ph" with "f".
- Replace all instances of "ight" with "ite".
- Replace all instances of "ll" with "l".
- Create a directory within the "assignment1" directory called "info".
- Create a file within "assignment1/info" called "name.txt", and write your first and last name in this file, on one line.
- In the assignment1/info directory, create a symbolic link to "name.txt" called "me.txt".
- Create a file within "assignment1/info" called "date.txt", and write the current date in the MM-DD-YY format.
- Rename the file "date.txt" file you created to "today.txt".
- Create a copy of the entire "assignment1/info" directory at "assignment1/info-backup".
- Open up the "planets.txt" file you created in step 2, and delete the line containing Pluto.
Poor Pluto :(
- Create a file in the assignment1 directory called "stats.txt".
- On the first line of "stats.txt", put the number of kilo-bytes the assignment1/info directory takes on disk (using the
du command). Do not put the units in the file, just the number.
- On the second line, put the number of bytes the file planets.txt file takes on disk (using the
ls command). Again, just put the number of bytes without any units.
To submit, first make sure that you are in the directory where you can see
the assignment1 directory, but not inside assignment1 itself:
Next, create a tarball of your assignment1 repository by
tar -czvf assignment1.tar.gz assignment1/
Then turn in the tarball by running:
submit username 1 assignment1.tar.gz
Where username is your UMW netid.
This will transfer your submission to the server where it will be graded.
It will print your grade to the screen and record your grade. You can submit
the assignment as many times as you like. Your best grade will be used.
If you wish to re-submit a new version of your assignment, you will only need
to run the tar and submit commands again, not the wget command.
Ian Finlayson | Licensed under a Attribution-NonCommercial 4.0 International License.