We are providing instructional accounts for your use in 61B. However, you're not required to use this account, and you may find yourself using it only for checking grades. Note that you ARE required to use your GitHub account, even if you're working on your own computer.
A. Registering & Updating Password
You should have an instructional account sheet with your login and password. Make sure that your assigned GitHub repository matches your login. Your login should be either two or three letters long (e.g. dp, afg).
Please make sure to register for the course. If you're working on a lab computer, you can do this by typing this command into the terminal:
register
You can also change your password using:
ssh update
If you're working on your own computer, you'll have to connect remotely first. After you've connected, you can use the commands above to register and change your password.
B. Accessing Remotely
Note: In this class, you will not need to SCP work back/forth due to using the Git version control system. This system is covered below.
Regardless, you may wish to access your instructional account remotely from a different computer (for checking grades, for example).
If you are a Windows user, you will need to use PuTTY to login to your class account from your own computer. This is a helpful video created by CS 61A.
If you are on an OSX or UNIX computer, you can use your Terminal to access your
class account remotely. To access your class account, use this ssh command:
ssh -X cs61b-**@ashby.cs.berkeley.edu
The ** should be replaced by your login.
C. UNIX Commands
The lab computers run on the UNIX operating system. As such, you can use xterm commands to make changes to your directory and files. Here 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 absolute 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 file1 from the current directory. It will not work if
file1does 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 and create aduplicatecopy in thelab2directory.mv: move or rename a filemv lab1/original lab2/originalThis command moves
originalfromlab1tolab2. Unlikecp, mv does 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).