0

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.

3
  • 1
    You can do Session multiplexing, but if you only need to upload a single file, just do an scp of the file from a different terminal.
    – Anthon
    Jan 31, 2016 at 18:55
  • 1
    As it's your first project it's probably not a huge .ccp file. So just copy it to clipboard on your own home PC and paste it into a vim session within PuTTY on your school's server.
    – steve
    Jan 31, 2016 at 19:21
  • That's not very descriptive. Are you wanting to move the file from the linux server to your machine, from your machine to the linux server, or from the linux server to somewhere else online? In the first two cases, use scp or sftp, in the last case it depends on where you're putting it. Jan 31, 2016 at 19:24

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .