Welcome to the first lab in the CS 143 course. For this course, you are going to need a SEAS account. If you do not have a SEAS account, please talk to the front desk to get one set up ASAP.
On your desktop, there is a program called Secure Shell Client. This program allows you to ssh into the SEAS server in order to work on your files. Normally, this program is also available for download from the GWU help desk homepage, so you can work from anywhere with an internet connection. Unfortunately this is not currently the case. Another such program is called PuTTY. For this course, you should do all your work through one of these two programs, directly on the server. We will cover how to do this later.
The server you will be working on this semester is referred to as hobbes. The Host Name is hobbes.seas.gwu.edu. In the Secure Shell Client, click Quick Connect, enter in this name into the host name section, and put your SEAS user name in for the user name. Clicking connect will prompt you for your SEAS password.
NOTE: When you first log in, you will be in the ksh shell. This shell is not very user friendly. Type bash into the command line to change to the bash shell. This shell is more user friendly, allowing you to press the up arrow to reference previously typed commands.
Please review the list of commands above. They will be used throughout the semester. Note that the directory you start in when you log into hobbes is referred to as your home directory.
In Unix, there are two types of paths: Relative and Absolute. A relative path is a path that relies on your current location in the Unix directory structure. An absolute path is a path that is the same from any location in the directory structure. An absolute path always starts from the root (/) directory. For example, if there I am in my home directory, the absolute path to my cs143 directory is /home/student/cssmith/cs143, while the relative path to it is just cs143.
In your home directory create two directories (see the above link to view
commands), a cs143 directory, and a submit directory. We need
to alter the permissions of your submit directory so that we will be able to
access your files. We will use the chmod command.
chmod a+rx submit
This gives everyone read and execute privileges to your submit directory. We can check the permissions through the ls -l command. The first column lists the permissions for the listed file. The first character tells you whether or not the listing is for a directory. The next three characters are your personal (u) permissions for the file, the middle three characters are for group (g) permissions, and the final three characters is for others (o) permissions. An r is for read permissions, w for write, and x for execute. Full permissions are represented with rwx. If a permission is not present, a - takes its place.
permissions for the submit directory should be drwxr-xr-x.
Note: Compiling a program that consists of multiple files is more complicated than this. We will cover how to do such when necessary.