Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How can I upload my .cpp file online while logged into schools Linux server through SSH?

I am currently in a basic programming class, and I finished my first project and it is a .cpp file. I am logged into the Linux server but I do not know how to upload a .cpp file online when I can only find the file while in SSH. Professor didn't show us anything so I have no idea where to start.
by

1 Answer

Bharatgxwzm
I believe you wrote the .cpp file on the Linux server, and now you want to get the file from the Linux server to your home computer, and then from your home computer so that you can submit it to your class's website.

To get the file from the Linux server, first find out where the file "lives". So, whilst SSH'd into the Linux server, do this:
$ readlink -f path/to/your/*cpp
/home/rschulj/homework/foo.cpp


The resulting path points to the file.

Now on your home computer, secure copy (scp) the file from the server:
$ scp /home/rschulj/homework/foo.cpp ~/foo.cpp

Login / Signup to Answer the Question.