Linux – How to copy from 1 computer to another computer with Linux shell commands

linuxscp

I want to copy a file (home/remote_computer_user/Desktop/test1.txt) from my remote office computer (a permanent URL + open port) to my home computer (home/home_computer_user/Downloads/).

How can I do this with shell commands in Linux?

My current thoughts:

  1. ssh <user>@<computer1address> -p <port> – gives me a shell on the remote computer
  2. (I think I should use scp, but I dont how exactly how in my case)

What are the exact commands I should use?

Best Answer

It should be something like:

scp -P <port> user@comp1:Desktop/test1.txt ~/Downloads/

Run this on your home PC.

Hope this will help you.

Related Question