Upload files with SCP

Prerequisites:

  1. scp (pre-installed on most Linux distributions)

Let’s say your student ID is sdiABCDEFG and lets say you have to upload your assignment to the following address:

/home/users/kXX/projectN/sdiABCDEFG/

Here are is a way to upload your assignment with Linux SCP:

Step 1 – Create a directory locally

It could be named with your SDI account or with the name of the project (or a combination).

You don’t have to create it with a terminal. You can use the file manager of your choice (e.g. Nautilus)

Step 2 – Copy all the deliverable files to that directory

Copy all the files you have to deliver to that directory.

Usually the only files you should include are all the header files (.h), the source files (.c, .cpp, .cc), the readme (PDF or TXT) and the makefile. But don’t forget to read the assignment description to verify you are including all the requested files.

Step 3 – Compress them

Simply create a zip file or a tar file with all the mentioned files. Name it with your SDI number.

The command to tar and zip the folder is:

tar cvfz sdiABCDEFG.tar.gz directoryname

Step 4 – Open a terminal to that directory

Either with the file manager of your choice or via a terminal.

Step 5 – Upload the file via SCP

Use the following command to upload the zip file:

For a zip file:

$ scp sdiABCDEFG.zip sdiABCDEFG@linux30.di.uoa.gr:/home/users/kXX/projectN/sdiABCDEFG/

For a tar file:

$ scp sdiABCDEFG.tar.gz sdiABCDEFG@linux30.di.uoa.gr:/home/users/kXX/projectN/sdiABCDEFG/

Note that linux30 is an example, if it is online, you could try other remote hosts like linux20, linux21 and so on.

Before running the command above, you should replace XX with the project number, sdiABCDEFG with your SDI number and linux30.di.uoa.gr with a valid active host of the University.

 

 

 

 

Leave a Reply