LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 01-12-2010, 02:08 PM   #1
SuperDude123
Member
 
Registered: Nov 2008
Posts: 158

Rep: Reputation: 30
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?
 
Old 01-12-2010, 02:13 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Use scp - it goes over same protocol as ssh.

Type "man scp" for more details.
 
1 members found this post helpful.
Old 01-12-2010, 02:32 PM   #3
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
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.
 
Old 01-12-2010, 03:14 PM   #4
Skaperen
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
Blog Entries: 31

Rep: Reputation: 182Reputation: 182
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).
 
Old 01-12-2010, 05:40 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,443

Rep: Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791
A good GUI tool is Filezilla, but I'd usually use scp if it's Linux - Linux.
 
0 members found this post helpful.
Old 01-12-2010, 06:03 PM   #6
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
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.
Old 01-12-2010, 06:52 PM   #7
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Rep: Reputation: 16
Use WinSCP if you want download from Linux to Windows.
 
0 members found this post helpful.
Old 01-12-2010, 10:33 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,443

Rep: Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791Reputation: 2791
... and Putty provides pscp at the MSWin cmd line.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
YAST Download folder Digital Suse SUSE / openSUSE 2 09-23-2007 01:04 PM
What folder to download programs to? JR67 Linux - Newbie 3 12-22-2006 11:04 PM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 02:09 PM
symlink from ares download folder desheikh Linux - Newbie 2 09-19-2005 02:47 PM
SaveTo /Download /Folder Locations xwastedmindx Linux - Newbie 2 06-13-2003 06:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration