Networking I Fall '97 UNIX Review 1. Match each command below with its correct description by placing the number of the description on the blank in front of the command. _2__a) cd .. 1) goes to user's home directory _3__b) cd . 2) goes to parent directory of current directory _1__c) cd 3) goes to current directory 2. Describe what the commands below have in common and what differences they have. a) cd netclass go to ./netclass (in the current directory) b) cd /home/kcollins/netclass go to the netclass directory in ~kcollins (/home/kcollins) c) cd ~mshibla/netclass go to the netclass directory in ~mshibla (/home/mshibla) 3. Describe what each of the commands below will show on the screen when executed from a user's Binx account. a) ls -la long directory listing + filenames beginning with "." (all files) b) ls | more normal directory listing, redirected to a pager c) ls *.txt normal directory listing of files (but not those beginning with ".") ending in ".txt" 4. Before the commands below were executed, my directory contained the following: file1 class file2 prog.c main.pas file3 shellscript public_html file4 Show the contents of my directory after the commands below are executed. binx~>mkdir netclass binx~>cp file1 netclass binx~>mv class.txt grades.txt binx~>mv shellscript netclass binx~>rm main.pas binx~>rmdir netclass Directory not empty error binx~>cat file2 > newfile binx~>cat file3 >> newfile file1 file3 prog.c file4 grades.txt netclass public_html newfile file2 5. A sysadmin is searching for a particular user name (dma) in the password file. If each line in the file has the format below, what command will return the only line with the desired name? dmason:x:1048:1375:Danny Mason:/users/dmason:/bin/csh grep ^dma: /etc/passwd 6. Match the file permission with the desired end result. _4__a) Allows only the owner to read, write, and 1) 777 execute 2) 755 _5__b) Allows everyone to read the file, but only the 3) 766 owner to write and execute it 4) 700 _2__c) Allows the directory to be accessed by 5) 744 everyone, but not written to by anyone other 6) 666 than the owner 7) 655 _2__d) Allows an executable file to be read and run 8) 644 by everyone, but only written to by the owner 9) 665 _10_e) Allows the owner and the group read and write 10) 664 privileges, but the world can only read the 11) 555 file 12) 544 7. Each of the following scripts was designed to anwswer a quesion. Determine an appropriate question for each. a) who | wc -l How many people are currently logged in? b) ps | sort | tail -1 What is the alphabetically last named process I have currently running? c) who | sort +4 | tail -1 Who was the person who logged in most recently? 8. A common problem encountered by those just starting web pages is that a page or image is not accessible by anyone other than the creator. Describe a possible reason for this problem. wrong permissions on the file (700 or such)