=================================================== Assignment #04 - more command line directory work =================================================== - Ian! D. Allen - idallen@idallen.ca - www.idallen.com Read *all* the words in this assignment before you begin to type. Available online: Monday September 23, 2012 Goals: Continue to RTFM (see the Class Notes on how to do this). Execute some simple Linux commands to find, move, and delete files. Copy-and-paste some Linux output into a plain text file and submit. Deliverables and due date: DUE: 12:00noon on Monday October 1, 2012 1. Create some directory structure in your CLS account. I will mark this directory in your account on the CLS; there is nothing to upload for this deliverable. The DUE date applies. 2. Upload an assignment04.txt answer file before the DUE date. Late assignments or wrong file names may not be marked. Be accurate. Course Linux Server (CLS) Deliverables: I will mark CLS deliverables in your account on the CLS; there is nothing to upload for this part of the assignment. The DUE date applies. Look in the Class Notes for Lab Worksheet 4 for help in completing this assignment. File Submission method: Create a plain text file using the *exact* name: assignment04.txt Upload the file via the assignment04 "Upload Assignment" facility in Blackboard in a manner similar to how you submitted the previous assignments (but upload under assignment04). Be exact! WARNING: Some inattentive students upload Assignment #4 into the Assignment #3 upload area. Don't make that mistake! Be exact. ============================================================================== See the Class Notes Lab Worksheet 4 for help in completing this assignment. You may find that pathnames display better if you widen your terminal window so that pathnames don't wrap on your screen when you show them. (You must widen the PuTTY terminal window *before* you run a command; PuTTY will not re-wrap text that is already on your screen.) 1. Execute this exact command line in your account on the CLS: $ ~idallen/cst8207/12f/assignment04/create.sh There is a leading tilde character in front of "idallen". The command script will create a directory named "assignment04" in your HOME directory. It will contain some sub-directories and files. You can re-execute the above line to start over from scratch, if you make errors in this assignment. To know what has been done, you should use a command that will recursively show all the files and directories just created. Part I ------ All the following commands in this Part I apply to files and directories under the new "assignment04" directory. You may have to use commands to find some of the file names mentioned here; they may be located under sub-directories. Some of these tasks may require more than one command to complete. 1. Find and read the file named "README.txt". Read and then delete the file "foo.txt" that is in the same directory as "README.txt". (Do not delete any other decoy files named "foo.txt" that may be in different directories.) 2. Move (rename) the file "dst" to be "dst.bak". (This is a *move*, not a *copy*.) 3. Directly under the new "assignment04" directory, create a new empty directory named "dst". (Make sure you create "dst" under assignment04, not in your HOME directory.) 4. Find the *file* named "services" (not the directory with the same name) and move (rename) that "services" file to be named "ports" under the new directory "dst". (This is a *move/rename*, not a *copy*.) Make sure you move the *file*, not the directory with the same name. Part II ------- 5. Under the directory tree ~idallen/cst8207/12f/assignment04/maze find and read the file with a name that looks like "abcd0001.txt" where the "abcd0001" part of the name is your own account userid. You might want to use a command that finds files by basename to do this. (Do not try to use "cd" and "ls" to find the file; the maze is big.) 6. Copy your personal "abcd0001.txt" file into the "dst" directory you created above, using the new name "me.txt" under "dst". Read the file to make sure it's the right one after you copy it into "dst". Your instructor will mark this directory in your account on the due date. Leave it there on the CLS. Do not delete it. 7. As you did in the previous assignment, copy-and-paste into the plain text submission file the command line and output of the following Unix command line: $ find assignment04 -ls You may find that pathnames display better if you widen your terminal window so that pathnames don't wrap on your screen when you show them. Widen the PuTTY window, then run the "find" command. 8. Submit the Plain Text file with the exact name before the due date. READ ALL THE WORDS. OH PLEASE, PLEASE, PLEASE READ ALL THE WORDS! -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/