Review Exercise 6
Sobell, Chapter 7 (pg 244)
Class notes, general Unix stuff you should know
Due Date: 4/20/01


Please complete the following Review Exercises.
Place your answers underneath each question using a
Unix text editor.  Turn in your answers as follows: turnin ex6 exercise6.txt 

1. Describe the similarities and differences between these utilities:

   a. rcp and ftp
		Both rcp and ftp are used to transfer files from one system to another.
		ftp is interactive.  rcp works in the same manner as cp.
	
   b. rlogin and telnet
		Both rlogin and telnet can be used to connect to a remote computer
		on a network.  telnet gives you a login prompt.  rlogin assumes
		your login name on the remote system matches that on your local
		system.  telnet is designed to work on non-Unix sytems.  telnet also
		lets you configure many special parameters such as how RETURNS
		are handled.

   c. rsh and rlogin 
		rsh allows you to run a command on a remote system without loggin in.
		e.g. rsh white ls  (will do an ls on machine white)
		rsh without any arguments just to a rlogin.

2. Explain the client/server model, and give three examples of services
   that take advantage of this model on Solaris systems.

	The client/server model dominates Unix and Solaris system networking.
	The server system offers services to its clients and is usually
	a central resource.  A server can be thought of as a program that
	serves you something, e.g. a file server is a program that serves you files.
	The following are examples of client/server models:

	i) DNS (Domain Name Service)  type: nslookup ip.address
	ii) NIS (Network Information Service) type: ypcat group
	iii) Web server (clients make requests and web pages are served)

3. Explain what happens if you transfer a binary file while running ftp in
   ASCII mode.  What happens if you transfer an ASCII file in binary mode? 

	Binary mode transfers an exact, byte-for-byte image of a file.
	ASCII mode performs end-of-line conversions between different systems
	and is consequently slower than binary mode.  Unless you specifically
	need to convert the end-of-line characters, use binary mode.
	In Binary mode, you can both ASCII and binary files.  in ASCII mode,
	you can only transfer ASCII files successfully.

4. An interesting language named Perl was developed for Unix systems.  It is
   in the public domain (free).  How can you use the Internet to find a copy
   and download it to your system?

	Use a web search engine, such as www.google.com, type in: Perl
	Or, go to http://metalab.unc.edu/pub/solaris and search for it.
	Click to download it.

5. How can you determine what group you are in?

	id or groups

6. What is the simplest command to compile the following C program: random.c ?

	gcc random.c
	This will create an executable in your working directory called: a.out

7. What is the simplest command to compile the following Fortran program: random.f ?

	f77 random.f
	This will create an executable in your working directory called: a.out

8. How do you access a floppy disk on a Sun workstation?

	Insert the floppy, type: volcheck
	Now, the files on the floppy can be found at /floppy/floppy0
	just like it was a normal directory.

9. Give a command to recursively gzip all your files starting
   at your home directory.

	cd into your home directory (cd )
	gzip -r *

10. Give the commands to find all your processes and to kill one of them.

	ps -auxww | grep 
	e.g. ps -auxww | grep ray
	ray       1913  0.0  3.2 1452  956 pts/7    S   Nov 15  0:14 tcsh
	ray      22429  0.0  3.9 3068 1148 ?        S   Dec 01  0:00 /usr/openwin/bin/x
	To kill the tcsh process: kill -9 1913
	1913 is the process id number