-   Linux - Newbie (
-   -   Download a folder over ssh (

SuperDude123 01-12-2010 02: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 02:13 PM

Use scp - it goes over same protocol as ssh.

Type "man scp" for more details.

cantab 01-12-2010 02: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 03:14 PM

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


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.


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 05:40 PM

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

zhjim 01-12-2010 06:03 PM

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

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

scp ./files_to_copy
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 06:52 PM

Use WinSCP if you want download from Linux to Windows.

chrism01 01-12-2010 10:33 PM

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

All times are GMT -5. The time now is 09:43 PM.