UNIX, Pico, and FTP Assignment

Log on to your Mason account using a terminal program such as SSH Secure Shell.

From the menu, choose File | Log session… and save the session as log.txt. [If you should accidentally be disconnected from or logout of SSH, your log.txt file is automatically saved. To pick up where you left off, start a new log file, and give it a new name (log2.txt, for example).

Refer to a list of simple Unix commands, such as those in the on-line Manual, as necessary. It helps to learn the material if you play around by making, copying, renaming, and deleting files and directories such as suggested in the Manual practice problems. There are also Unix help pages that you can access from the Help menu in the Chem350 menu.

Do parts 1-4 first. If you do them later, the subsequent exercises will interfere with the results. The overall goal is to show the file structure on your account at the beginning and at the end of the exercise. If you decide to re-do this assignment, first delete all the files you created so you start where you started the first time.

1. While in your home directory, type clear. Type pwd. Type the command ls -alp. The output of the list command is "printed" to the monitor.

From the menu bar in SSH, print a hard copy of what you have just done. Turn in the printout as part of this assignment.

2. Type the command ls  -alp  >start-files. The > symbol tells the computer to redirect the output of the command (in this case, the contents of your list) into a file called "start-files" that is then created.

(Issue the list command to the screen again to see the newly created file included in the list. If you want to read the file itself, type more start-files .)

3. In preparation for creating your web site, you need to make some changes to your account. [If you already have a website, follow the directions at the end of this assignment instead of the next sentence.]

If you have never created a website on your Mason account, follow the directions in the Manual for the procedure “Creating a Directory for a WWW Site”. Follow the directions exactly, with no deviation!

4. Using the Pico editor

In your home directory, make a new directory called temp. Change to the temp directory.

There may be times you want to edit (or create) a text file while in your Mason account using the Pico text editor.

Type the command cal 2009. You should see a calendar of the current year displayed. (If it doesn't fit on one screen, type cal 2008 |more and then use the space bar to page through the remainder of the output.)

Type the command cal 2009> cal. Again, you are redirecting the output of a command to a new file named "cal".

Type pico cal to open the Pico text editor with the calendar file opened.

Edit the file: a) Create a title “Calendar for ______” (where you enter your name instead of the blank); b) delete the months June.-December; the resulting calendar should be neatly arranged; c) underneath the calendar, type your Final Exam schedule (dates, days and times) for all your classes for this semester in chronological order; d) "read" the 350syll.txt file into the cal file (download the file to your PC/flash drive first and then upload it to your Mason account).

Save the file in Pico as cal.txt.

5. Return to your home directory.

List the files in your home directory using the options -lR (the lowercase letter "el"; the uppercase letter "ar"). (Make sure you understand what the R option does.) Re-issue the command, but now redirect the screen output of the command to a file called end-files.

Copy the begining and ending files you generated, now with the extension .txt (start-files.txt and end-files.txt) while still in the same directory.

6. Download the three .txt files you created in this exercise from your Mason account to a PC using FTP. Make sure you transfer the text files as ASCII files. Attach the three files you created in an e-mail to me in the order they were created. Use the subject line FTP files.

7. From a text editing program on a PC (such as Notepad, not Word), print the end-files.txt file. The printout should have your name and computer number in the automatic header and the file name in an automatic footer.

Print the log.txt file with the same information in the header and footer.

Summary

  • Turn in for this assignment: all printouts stapled together in the order they are created in the assignment (log.txt is last) and one e-mail with three attachments (not log.txt).

 

Notes

  • None of the files you might have generated during this exercise should appear in a directory other than the one specified.
  • If you decide to re-do parts of the assignment, please delete all files you created.
  • Check your log.txt file before printing and submitting it. There should be content in the file that corresponds to your activity during your SSH session.
  • If you accidentally list one of the higher level usr directories, your log file will overflow and you must start a new one.

 

If you already have a website at GMU, check the instructions in the Manual and make sure that your home and public_html directories have the same permissions as specified there. If your public_html directory is a disorganized mass of files, you should delete what you don't want anymore, and begin to organize the remainder. Read ahead in the manual to see how an existing website will be incorporated into CHEM 350.


Chemistry 350
George Mason University