LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 03: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, 03:13 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,580
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
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, 03:32 PM   #3
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: *buntu, Vector
Posts: 499

Rep: Reputation: 102Reputation: 102
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, 04:14 PM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, Ubuntu, Amazon Linux
Posts: 1,830
Blog Entries: 21

Rep: Reputation: 119Reputation: 119
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, 06:40 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
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, 07: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, 07: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, 11:33 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
... 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 02:04 PM
What folder to download programs to? JR67 Linux - Newbie 3 12-23-2006 12:04 AM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 03:09 PM
symlink from ares download folder desheikh Linux - Newbie 2 09-19-2005 03:47 PM
SaveTo /Download /Folder Locations xwastedmindx Linux - Newbie 2 06-13-2003 07:56 PM


All times are GMT -5. The time now is 05:01 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration