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.
You can check your information registered with the course by typing in
$ check-register
You can change any incorrect or out-of-date information by typing
$ re-register
You can also change your password using:
$ ssh update
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 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 hw
This command will change your directory to
hw
.pwd
: present working directorypwd
This 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 directoryls
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 directorymkdir dirname
This command will make a directory within the current directory called
dirname
.rm
: remove a filerm 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 indir1
in addition todir1
itself. Be careful with this command!cp
: copy a filecp lab1/original lab2/duplicate
This command will copy the
original
file in thelab1
directory and and create aduplicate
copy in thelab2
directory.mv
: move or rename a filemv lab1/original lab2/original
This command moves
original
fromlab1
tolab2
. Unlikecp
, mv does not leave original in thelab1
directory.mv lab1/original lab1/newname
This command does not move the file but rather renames it from
original
tonewname
.
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).