bash command to copy file from one computer to another

bash, cp, macos, unix

Solution

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

Problem

Wasn't quite sure how to word this but let's say I've used `ssh` to remote into my friends MacBook (macbook_b) from my MacBook (macbook_a). What command would I use to copy a file/directory to my MacBook (macbook_a) from my friends MacBook (macbook_b)? Thank you.

Original source

Related problems