Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-12-2010, 02:08 PM
|
#1
|
Member
Registered: Nov 2008
Posts: 158
Rep:
|
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?
|
|
|
01-12-2010, 02:13 PM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
Use scp - it goes over same protocol as ssh.
Type "man scp" for more details.
|
|
1 members found this post helpful.
|
01-12-2010, 02:32 PM
|
#3
|
Member
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553
Rep: 
|
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.
|
|
|
01-12-2010, 03:14 PM
|
#4
|
Senior Member
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,918
Rep: 
|
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).
|
|
|
01-12-2010, 05:40 PM
|
#5
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,443
|
A good GUI tool is Filezilla, but I'd usually use scp if it's Linux - Linux.
|
|
0 members found this post helpful.
|
01-12-2010, 06:03 PM
|
#6
|
Senior Member
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
|
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)
|
|
1 members found this post helpful.
|
01-12-2010, 06:52 PM
|
#7
|
Member
Registered: Oct 2008
Posts: 48
Rep:
|
Use WinSCP if you want download from Linux to Windows.
|
|
0 members found this post helpful.
|
01-12-2010, 10:33 PM
|
#8
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,443
|
... and Putty provides pscp at the MSWin cmd line.
|
|
|
All times are GMT -5. The time now is 01:54 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|