Networking I Fall '97 UNIX Quiz 1 1. I have three directories in my home directory. Each has a different purpose. For each directory, fill in the appropriate value for the chmod command. (3 pts) a) public_html holds the web pages I want available for public viewing chmod 755 public_html b) data_files holds files that my students may read, but may not change chmod 755 data_files c) course_files holds programs that only I may read or change chmod 700 course_files 2. Your directory contains the following: (4 pts) files: directories: prog1.pas public_html script1 mail file1.txt rain.dat page.html picture.jpg Explain the results of the following commands: a) mv page.html index.html rename page.html to index.html b) mv index.html public_html move ./index.html to public_html directory c) mv picture.jpg public_html move ./picture.jpg to public_html directory d) mv rain.dat data_files rename ./rain.dat to ./data_files (still a file) 3. Write a description of the outcome of each command (be as detailed as possible): (6 pts) a) who | sort print a sorted list of currently logged in users b) who | grep mshibla print "who" output of mshibla's login session c) ps | sort | wc -l sort a list of my currently running processes (?), then print a count of them (why sort them?) d) head -5 filename print the first 5 lines of a file "filename" 4. Write the command which will print to the screen the long listing (including file permissions, etc.) of the directory one screen at a time. (1 pt) ls -l | more 5. In my directory, I have several files named netclass1, netclass2, netclass3, etc. Write a single command which will make all of these files readable, writeable, and executable by me only. (1 pt) chmod 700 ~/netclass* 6. Laura Goldhar has a gif file of the Blair banner (banner.gif) in her public_html directory. You want to copy it to your public_html directory. You are currently in your home directory. Write the commands you would use to do this. (2 pts) cp ~lgoldhar/public_html/banner.gif public_html 7. You have two versions of a program in your directory. One is called version1.pas and the other is called version2.pas. You have decided to submit version2.pas to your teacher for grading. Your teacher requires that your program be named "yourlastname.pas" and that you send it to her as an attachment. Write the commands you will type in order to meet these requirements. (2 pts) mv version2.pas youlastname.pas pine c (fill out address and subject) ^J (or fill out Attchmnt: field) yourlastname.pas ^X (to send) -or- (not fulfilling the requirements of the question, but what I'd do) cat version2.pas | mail teacher -s "yourlastname.pas" 8. Write the command you need to change your password and describe the guidelines for a good password. (1 pt) passwd 5-8 characters, not a dictionary word, not a name, with at least two different types of characters in it (letters and numbers, letters and punctuation, etc.)