LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Download a folder over ssh (https://www.linuxquestions.org/questions/linux-newbie-8/download-a-folder-over-ssh-781771/)

SuperDude123 01-12-2010 03:08 PM

Download a folder over ssh
 
How do I (through command line) download folder X and all of its content from the remote system to my local system?

MensaWater 01-12-2010 03:13 PM

Use scp - it goes over same protocol as ssh.

Type "man scp" for more details.

cantab 01-12-2010 03:32 PM

scp for a batch copy, or sftp for a (crude) interactive interface. (It's possible the server will only support one). Or you can use GUI tools - it's likely your desktop's usual file manager can handle it.

Skaperen 01-12-2010 04:14 PM

Alernatives include rsync which uses ssh when the target or source syntax is like user@host: ... and running tar via ssh.

Code:

rsync -av user@host:/home/user/folderX/. /home/usr/folderX
Note the "/." at the end of the source ... it prevents the directory "folderX" from being created inside "folderX" on the target.

Code:

ssh user@host 'tar cf - folderX' | tar xpvf -
The tar syntax may vary somewhat on some systems (do "man tar" on both systems to be sure).

chrism01 01-12-2010 06:40 PM

A good GUI tool is Filezilla, but I'd usually use scp if it's Linux - Linux.

zhjim 01-12-2010 07:03 PM

For completnes sake
 
1. option
Login to the computer you want files to download to
Code:

scp username@ip.the.files.are:/username/path/to/file/you/want/do/downaload ./
2. option
Login to computer files are on
Code:

scp ./files_to_copy username@ip.to.copy.files:/path/to/copy/files/to
to be honest. scp man page is a bitch to understand. AT least for me it did. Just mind the : betweeen ip. Use the right username before ip. Use the exact filename (absolute path works wonder)

nodopro 01-12-2010 07:52 PM

Use WinSCP if you want download from Linux to Windows.

chrism01 01-12-2010 11:33 PM

... and Putty provides pscp at the MSWin cmd line.


All times are GMT -5. The time now is 02:16 PM.