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.
1 Answer
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
Now foo.cpp is in your home directory. Upload it to your school homework site.
scp
of the file from a different terminal.scp
orsftp
, in the last case it depends on where you're putting it.