SNOOPING AROUND

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.


DISKWALKING IS THE WAY TO LEARN ABOUT UNIX

1.  Again, secure shell into hilton.cec.wustl.edu as cse100x.

2.  If you say cd, you change directories.  This is a bit
	like opening a folder in windows, but it is also a 
	more of a commitment, like lunch.  In UNIX, you don't
	get to switch between folders just by moving your mouse.
	If you're in a folder, you're in that folder.  Oh btw,
	they're called directories.

	Say pwd.  That prints the working directory.  ls,
	as you know, lists the files.

	Say cd .., which moves to the parent directory.

	Try it a few times.

	Are you lost yet?

	Say cd ~, which takes you back to your home directory.

3.  When you do an ls, you can see what are the subdirectories
	of the current directory. 

	Use cd to go to the top.  That's /.  Or you could have
	just said cd /.  

	Now descend into one of the subdirs, for example, /etc.

	Keep going down.  How far down can you go?

	Try a different path.  I want to see if you there is a
	directory that is fifteen generations from the root.
	That would mean something like /ect/foo/bar/gah/blah/.../temp

	But I bet you can't find anything deeper than about 8.

4.  Try to find where the students' home directories are kept.
	Any reason why this is the s directory and not the students
	directory?  Why is it broken up into subparts?

5.  If you are at the appropriate level, say .../s/k, which contains
	the student accounts with usernames starting with k,
	you can do something like

		ls */.www-docs

	which would list the contents of web directories for those
	students who give you permission to do so.

	It's a bit controversial whether you should be allowed to 
	do this, since people who don't want you looking at their
	stuff often forget to protect their files.  Such is life on
	a multi-user UNIX machine.  Don't assume files can't be read
	by fellow users!

6.  Some of the most interesting stuff is in /var/log/ or /etc or /dev.
	Can you figure out the organization of these directories?

7.  Some of the best reading is in /tmp.  This is where people put
	files that they don't want in their home directories, and
	which can be removed by the sysadmin when space is needed.
	Mostly /tmp files are not visible to you.  Can you read any
	of them using less?

8.  You can create a crumbs-in-the-woods trail using pushd instead of
	cd.  Try cd ~, then pushd to the top of the file system, /.
	You'll say pushd .. instead of cd .. and it will keep telling
	you where you have been.  popd pops the stack and returns you
	to the directory where you were before.  
	
9.  I like pushd so much that i use alias to rename my cd as pushd.
	Try it.  Say "alias cd pushd".  Now when you use cd, you 
	are actually using pushd.  I alias - to popd so i can use
	a single character to pop my directory history stack.

10.  As long as I have used the word history, say history to the
	command prompt (the shell, as we call it).  Nice, huh?
	I'll show you in the next lab how you can access your command
	history in a hurry.