D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] file transfer via router

 

On Wed, 8 Aug 2012, Neil Winchurst wrote:

I know that SSH stands for secure shell, but that is as far as it goes.
The answers to my query have made me realise that there is a lot still
to learn. I will be looking into this, even if I don't use it to
transfer the files.

If you have 2 Linux PCs on the same LAN (or even different LANs as long as they can route to each other)... Then:

  scp user@otherPc:/path/to/file .

even if they just have IP addresses:

  scp gordon@xxxxxxxxxxx:file.txt .

will copy the file "file.txt" on the PC with IP address 192.168.1.2 to your local PC. You can push as well as pull:

  scp filehere.txt gordon@xxxxxxxxxxx:

Remember the colon.

You can also do recursive copys:

  scp -r gordon@xxxxxxxxxxx:/path/to/dir/ localdir/

will do a recursive copy.

Then only requirement is knowing the username and password on the remote PC.


scp is great for one or 2 files or a whole directory, but when you want to do more, then you need to look into rsync - which uses scp under the bonnet.


Gordon

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq