[wellylug] Ssh cp question

Joerg Frochte joerg.frochte at uni-essen.de
Fri Jun 13 19:07:37 NZST 2003


* Lyndsay Mountfort <lyndsaym at paradise.net.nz> [030613 08:42] schrieb:
> Andrew Presant wrote:
> 
> >Basic question for you:
> >
> >I'm trying to figure out how to copy a file/directory from one box to
> >another.
> >I understand cp /path/to/file /path/to/destination but how do you do it
> >across a network with ssh?
> >
> the command is scp
> 
> scp [username at origin-ip-or-network-name:]/path/to/file 
> [username at destination-ip-or-network-name:]/path/to/destination
> 
> username and ip or network name is not required for localhost.

supplement:

If it is a dircetory you want to you, use e.g. -r as usually (cp) 

scp -r dep/example jfr at nameofhost:dep/example

the path after the ':' is relative to your/the home directory.
You can also use absolute paths like  

scp -r dep/example jfr at nameofhost:/home/jfr/dep/example


Bye,

Joerg



More information about the wellylug mailing list