Using Instructional Accounts
Author: Sarah Kim

## 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).

## 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-***@cory.eecs.berkeley.edu

Replace *** with the letters from your login.

You may come across a message along the lines of

The authenticity of host 'cory.eecs.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.

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 directory

cd hw

This command will change your directory to hw.

• pwd: present working directory

pwd

This 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 directory

cd .

This command will change your directory to the current directory (aka. do nothing).

• ..: means one parent directory above your current directory

cd ..

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 directory

ls

This command will list all the files and folders in your current directory.

ls -l

This 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 directory

mkdir dirname

This command will make a directory within the current directory called dirname.

• rm: remove a file

rm file1

This command will remove file1 from the current directory. It will not work if file1 does not exist.

rm -r dir1

This command will remove the dir1 directory recursively. In other words, it will delete all the files and directories in dir1 in addition to dir1 itself. Be careful with this command!

• cp: copy a file

cp lab1/original lab2/duplicate

This command will copy the original file in the lab1 directory and create a duplicate copy in the lab2 directory.

• mv: move or rename a file

mv lab1/original lab2/original

This command moves original from lab1 to lab2. Unlike cp, mv does not leave original in the lab1 directory.

mv lab1/original lab1/newname

This command does not move the file but rather renames it from original to newname.

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 tab key for autocomplete or a list of possible names.
• If you want to retype the same instruction used recently, press the up key 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).