YOUR FIRST UNIX ENCOUNTER

As usual, if you have a problem, raise your hand.  When you are done,
come to the TA or instructor and make sure you have your completion
of the lab recorded.  Before you go, always log off your machine.


POKING AROUND

1.  Find secure shell and connect to hilton.cec.wustl.edu
	as cs100.

2.  Once you are there, try
	ls, whoami, who, w, and quota

	Are these commands all self-explanatory?

	If not, see if it helps to do "man ls"
	which brings the man page (the manual) for that command.

	If that still doesn't help, try google each of these commands,
	with the additional words "unix help".  You might have to
	search a bit to find decent help, but there is a lot of it
	out there!

3.  Try df, du, and top.

	These tell you what disks are available for your data,
	how much you are currently using, and what processes are
	running.

	You might want to say df|head, which gives the first
	dozen or so lines of the df command.  Likewise, du|head
	is good.  du|less is also a nice thing to try.  When you
	are using the command, less, you will want to use the
	space and the Enter key to move down.

	Once you are in top, it can be hard to get out.  ctrl-C works.o

4.  Unix has something called "job control" and you can say ctrl-Z
	to top, instead of ctrl-C, which kills the job. 

	Five times I want you to start the command top, then
	say ctrl-Z.  

	Now try the command, jobs.

	You can kill each of these by saying e.g., "kill -9 %1", 
	to kill job 1.

	If you want to resume a job instead of killing it, say
	"fg" of "fg %3", the latter putting job 3 in the "foreground".

5.  You will want to create your own folder, or directory.
	Say "mkdir name", where name is your name.  Don't use spaces
	or other non-alpha characters.  Unix doesn't like that.

	Now try ls.

	Try ls -l.  That's the letter l, the letter after k and before m,
	not the number one.

	In fact, try ls -a, ls -s, and ls -lt.  Any idea what the
	options are doing for you?  

6.  Go into your directory by saying, "cd name", where name is your name.

	Try "echo hello > hello.txt".

	Now ls.  In fact, try ls -l.

	Look at your file by saying "less hello.txt".

	Now try "echo goodbye >> hello.txt".

	What's in your file now?

	Try ls -l.  Do you see that your file grew in size?

7.  I want you to create three files.  One with names of people you like.
	I would start with Gwen Stefani in this one.

	The second file contains the names of people you don't like.
	Gavin Rossdale goes there.

	The third file contains the names of people who like you.
	Start with the TA's, since they like everyone.

	When these are done, rename the files one, two, and three,
	by using the mv command.  How?  You figure it out (google mv,
	or try man mv).

8.  cat one two three 
	will show the contents of all the files one after the other.

	Try a different order.

	In fact, try "cat one two three | sort".

	Pretty nifty, huh?  Try "sort +1" instead of "sort".

9.  See if you can sort the contents of each file individually.
	Show the TA.

	Any ideas how to save the results of each sort to a file,
	e.g., "cat one | sort" gets saved as "one.sorted"?

	Hint:  Use "> one.sorted" at the end of your command.

10.  Let's try something really good.  "lynx -dump cs.wustl.edu > save.cs"
	will save the cs.wustl.edu web page in the file, save.cs.

	Try it and examine the contents of the file (use less).

	Try downloading a page on the web that needs to have its
	data sorted, then use sort.  If you grab numerical data,
	you might try "sort -nr" or "sort -nr +10" to sort in
	descending order numerically on the 11th column.

	I would go to the stlouiscardinals.com stats page and
	start sorting, but it's up to you.