How to download file(s) from onyx to your local machine

A typical example is that we want to copy a project folder from onyx to our local machine. We will need to know the relative path (relative to our home directory) to the folder ononyx. Suppose that is workspace/program4. Then we can use the following command to copy the program4 folder to our local machine:

scp -r alice@onyx.boisestate.edu:workspace/program4 .

Here we use the recursive option since it is a directory and not just a file. Note that we must end the remote hostname with a colon (: after the edu). Then we need to provide the TO part. We provide a dot (`.') here to specify the destination as the current directory on our local system. Suppose we wanted to copy it to the workspace directory in our home directory on our local system, then we would have used:

scp -r USERNAME@onyx.boisestate.edu:workspace/program4 ~/workspace

Note it both cases above the name of the directory in our local system will be the same as ononyx. We can change it if we wish as follows:

scp -r USERNAME@onyx.boisestate.edu:workspace/program4 ~/workspace/newprogram4

Now the directory program4 will be copied as newprogram4 under the workspace directory on our local system.