8

I want to do the following:

scp root@server.ip.adress:/root/file.txt ~/homecomputer/directory

Instead of taking a file from the server though, I would like to send a file. How do I do this?

  • // , Upvoted for "clever" wording. An expert would not think that way. – Nathan Basanese Dec 27 '15 at 17:36
19

The syntax is:

scp source destination

So this time the source is your local (client) computer and the destination is the remote (server) computer.

If the file you want to send is ~/homecomputer/directory/foobar.txt, then from your local computer you can do:

scp ~/homecomputer/directory/foobar.txt root@server.ip.adress:/where/to/put

Check man scp to get more idea on this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.