bash command to copy file from one computer to another bash command to copy file from one computer to another unix unix

bash command to copy file from one computer to another


You can use scp (Secure Copy).

To copy FROM your machine to friends:

scp file_to_copy user@remote.server.fi:/path/to/location

In another direction:

scp user@remote.server.fi:/path/locatio/file_name file_name

If you need to copy an entire directory, you'll need to use the recursive flag, like this:

scp -r directory_to_copy user@remote.server.fi:/path/to/location


Assuming you're logged in on macbook_b:

scp file_to_copy username@macbook_a:/path/to/destination

or if you're logged in on macbook_a:

scp username@macbook_b:/path/to/file_to_copy local_destination


I think this link would help you with the answer you are looking for. In this you can use scp ssh source destination example for your scenario you have requested for.

Also refer to this question which has been already answered. It might help.