Submitting Homework on the SSH Server
When you develop programs on the ssh server you'll need to put your homework where I'll be able to find it in order to receive credit. Each homework assignment will be tagged with “HWxx” where the “xx” is a two-digit number referring to the number of the homework assignment. For each assignment you'll need to create a subdirectory named “HWxx” and put your files in there.
In order to do this you'll have to use a few shell commands:
Task |
Command |
Notes |
To create a directory |
mkdir directory_name |
|
To remove a directory |
rmdir directory_name |
The directory must be empty and cannot be the present working directory. |
To determine the present working directory |
pwd |
|
To change the present working directory. |
cd directory_path |
Two dots (..) as the directory path means to go to the parent directory. |
To make a copy of a file |
cp source_filename dest_filename |
You can also prefix the filenames with paths to copy across directories. |
To move a file to a different location or change its filename |
mv source_filename dest_filename |
You can also prefix the filenames with paths to move across directories. |
So for example, if you have to write a program for homework #5, you would make the HW05 subdirectory, make it the present working directory, use jmacs to create your source code file, compile it with g++ and then execute the file a.out like this:
sedwards@fccsci:~$ mkdir HW05
sedwards@fccsci:~$ cd HW05
sedwards@fccsci:~/HW05$ jmacs mycode.cpp
sedwards@fccsci:~/HW05$ g++ -Wall mycode.cpp
sedwards@fccsci:~/HW05$ ./a.out
Remember – the shell commands are case-sensitive. And be careful when deleting files, there's no way to get them back!