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. Accessing Remotely
Note: In this class, you will not need to SCP work back/forth due to using the Git version control system. Git is covered in lab 1.
Regardless, you may wish to access your instructional account remotely from a different computer. This could be useful for checking grades, or if you have trouble with your personal computer that prevents you from running your code.
If you are a Windows user, you will need to use a shell client like Git Bash (covered in lab1b or PuTTY to login to your class account from your own computer. This is a helpful video created by CS 61A. An alternate possibility is to use the Ubuntu shell for Windows.
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
** 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 directory
This command will change your directory to
pwd: present working directory
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 directory
This command will change your directory to the current directory (aka. do nothing).
..: means one parent directory above your current directory
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
This command will list all the files and folders in your current directory.
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
This command will make a directory within the current directory called
rm: remove a file
This command will remove file1 from the current directory. It will not work if
file1does not exist.
rm -r dir1
This command will remove the
dir1directory recursively. In other words, it will delete all the files and directories in
dir1in addition to
dir1itself. Be careful with this command!
cp: copy a file
cp lab1/original lab2/duplicate
This command will copy the
originalfile in the
lab1directory and and create a
duplicatecopy in the
mv: move or rename a file
mv lab1/original lab2/original
This command moves
cp, mv does not leave original in the
mv lab1/original lab1/newname
This command does not move the file but rather renames it from
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
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).