Getting Started
CS61A, Spring
2008
This guide is meant to help you use the computers in the lab.
The terminal and changing your password
When you first login, you'll be asked to enter some information. You should see the following:
Registration for course cs61a (if that's the wrong course,
please use Control-C and correct your settings first.)
Please enter an email address :
Fill in all the information they request. Make sure to give an email that you'll read. If you make a mistake entering any of this information, you can use re-register to try again.
Once that's finished, you should see a spot that looks like this:
h50 [1] ~ >
That box is called the terminal, and what you see is the terminal prompt. You can type commands at the terminal prompt, and it will do what you say. The first thing you want to do is change your password. So, at the prompt, type ssh update and hit enter. You'll see something like this:
h50 [1] ~ > ssh update
The authenticity of host 'update (128.32.42.154)' can't be established.
RSA key fingerprint is 32:f6:c1:00:72:5c:ea:47:6b:a8:c8:4c:f5:45:0d:1a.
Are you sure you want to continue connecting (yes/no)?
Just say yes and continue on.
The system will ask for your password (right now, that's probably the one on the login sheet). Type it in and continue.
You should see a menu. Hit enter to select "Change your Password."
Enter your old password (the one on the login sheet).
Enter your new password (this can be whatever you want it to be, so long as you follow the guidelines on the screen).
You will be asked to confirm your choice, and then press enter to return to the menu.
Exit the update system.
Getting started with emacs
For doing your work, you'll want to use emacs. Emacs is a text editor (somewhat like Notepad, only much more powerful). You can start emacs by typing it in at the prompt:
h50 [2] ~ > emacs &
The & sign makes emacs run in the "background" so you can still use your terminal. Once you open up emacs, you can open up the tutorial. Once you've read through that, you'll want to start Scheme. To do this type meta-S. The meta key is the one with the diamond. Hold down meta, and press S. This starts up the Scheme prompt.
Creating files
Creating files in emacs is easy. You can click on File -> Open file. This will bring up a small prompt near the bottom of the window. You can either open an existing file, or create a new one. For now, let's create a new one. Type in the name of the file you want to create (probably something like "pigl.scm"). Now emacs has created the file, and you're editing it. Don't forget to save your changes! Click on File -> Save (current buffer) whenever you want to save.
Navigating the filesystem
Your filesystem is organized into directories (folders) and files. The commands you'll be using most frequently are ls, mkdir, cd, cp, mv, rm, and rmdir. These commands are used from the terminal, NOT emacs. Let's take a quick look at each one. (Note that these are examples to give you an idea of how these commands work, and not necessarily what you should see when you type them!)
ls
Lists the contents of the current directory:
h50 [4] ~ > ls
pigl.scm lab1
mkdir
Makes a new directory:
h50 [5] ~ > mkdir lab01
h50 [6] ~ > ls
lab01/ lab1 pigl.scm
cd
Moves from one directory to another; you can use cd .. to go up one level (".." always stands for 'one level up'):
h50 [7] ~ > cd lab01
h50 [8] ~/lab01 > ls
h50 [9] ~/lab01 > cd ..
h50 [10] ~ >
cp
Copies a file from one place to another:
h50 [10] ~ > cp pigl.scm lab01/
h50 [11] ~ > cp pigl.scm pigl2.scm
h50 [12] ~ > ls
lab01/ lab1 pigl.scm pigl2.scm
h50 [13] ~ > cd lab01
h50 [14] ~/lab01 > ls
pigl.scm
h50 [15] ~/lab01 > cd ..
mv
Moves (or renames) a file:
h50 [16] ~ > mv lab1 lab01/
h50 [17] ~ > cd lab01/
h50 [18] ~/lab01 > ls
lab1 pigl.scm
h50 [19] ~/lab01 > mv lab1 lab1-transcript
h50 [20] ~/lab01 > ls
lab1-transcript pigl.scm
h50 [21] ~/lab01 > cd ..
rm
Removes/deletes a file from the filesystem; be careful when using this command. Unlike Windows, there is no Recycle Bin, so once you delete something it's gone forever!
h50 [22] ~ > ls
lab01/ pigl.scm pigl2.scm
h50 [23] ~ > rm pigl.scm
rm: remove pigl.scm (yes/no)? yes
h50 [24] ~ > ls
lab01/ pigl2.scm
h50 [25] ~ > rm pigl2.scm
rm: remove pigl2.scm (yes/no)? yes
h50 [26] ~ > ls
lab01/
Note that you can also use wildcards (so, we could have instead said rm pigl*), but be careful when using them!
rmdir
Removes an empty directory:
h50 [27] ~ > mkdir test
h50 [28] ~ > ls
lab01/ test/
h50 [29] ~ > rmdir test
h50 [30] ~ > ls
lab01/