Navigation
A. Obtaining an Instructional Account
Request an EECS instructional account here.
You should receive a login that looks like cs61b-***, where *** represents 2
or 3 letters, as well as a password. Memorize your login and hold on to your
password for just a bit (you can change it below).
You should now be able to use the lab computers using your login and password.
B. Accessing Remotely
You may wish to access your instructional account remotely from a personal or non-lab computer (checking grades, for example). If you are using a lab computer for today, you can come back to this section later.
Use your Terminal (or Git Bash if you're using Windows) to access your class
account remotely through the ssh command:
ssh cs61b-***@derby.cs.berkeley.edu
Replace *** with the letters from your login.
You may come across a message along the lines of
The authenticity of host 'derby.cs.berkeley.edu (128.32.42.40)' can't be established.
You may always ignore this message and type yes to proceed.
C. Registering & Updating Password
This section is done on the instructional account. If you are working on a lab computer, just login. If you are working from a personal computer, then ssh in as described in Accessing Remotely first.
Register for the course by typing this command into the terminal:
register
If nothing is outputted, that means you are already registered for the course and you can move on to the next step.
You can also change your password using:
ssh update
D. UNIX Commands
The lab computers run on the UNIX operating system. As such, you can use terminal commands to make changes to your directory and files. You will find that you can use most of these commands on your local computer as well. Familiarizing yourself with these commands are an important part of being a programmer; although we will not test you on this, these commands will make your life easier as you code. Below are some important ones that you may find useful in this course:
cd: change your working directorycd hwThis command will change your directory to
hw.pwd: present working directorypwdThis command will tell you the full path for the current directory you are in if you are not sure where you are.
.: means your current directorycd .This command will change your directory to the current directory (aka. do nothing).
..: means one parent directory above your current directorycd ..This command will change your directory to its parent. If you are in
/workspace/day1/, the command will place you in/workspace/.ls: list files/folders in directorylsThis command will list all the files and folders in your current directory.
ls -lThis command will list all the files and folders in your current directory with timestamps and file permissions. This can help you double-check if your file updated correctly or change the read-write- execute permissions for your files.
mkdir: make a directorymkdir dirnameThis command will make a directory within the current directory called
dirname.rm: remove a filerm file1This command will remove
file1from the current directory. It will not work iffile1does not exist.rm -r dir1This command will remove the
dir1directory recursively. In other words, it will delete all the files and directories indir1in addition todir1itself. Be careful with this command!cp: copy a filecp lab1/original lab2/duplicateThis command will copy the
originalfile in thelab1directory and create aduplicatecopy in thelab2directory.mv: move or rename a filemv lab1/original lab2/originalThis command moves
originalfromlab1tolab2. Unlikecp,mvdoes not leave original in thelab1directory.mv lab1/original lab1/newnameThis command does not move the file but rather renames it from
originaltonewname.
There are some other useful tricks when navigating on command line:
- UNIX can complete file names and directory names for you with tab
completion. When you have an incomplete name (for something that already
exists), try pressing the
tabkey for autocomplete or a list of possible names. - If you want to retype the same instruction used recently, press the
upkey on your keyboard until you see the correct instruction. This saves typing time if you are doing repetitive instructions (like running Java programs on command line while testing).