LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-13-2009, 05:12 PM   #1
h725
Member
 
Registered: Apr 2008
Posts: 114

Rep: Reputation: 15
question about ftp via command line


Hi,

how do you transfer entire directory via ftp (using command line)?
Maybe I'm wrong, but this is not possible with the simple "ftp" command and glob options?
Thank you
 
Old 01-13-2009, 05:23 PM   #2
DropSig
Member
 
Registered: Apr 2004
Location: Saskatchewan
Distribution: Ubuntu, Centos
Posts: 208

Rep: Reputation: 30
I believe it is not possible with simple ftp program
but check wget
wget -r $host
wget --help for more info or man wget

Last edited by DropSig; 01-13-2009 at 05:24 PM. Reason: forgot something
 
Old 01-13-2009, 05:26 PM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
you can use wget
wget -r ftp://ftp.foo.com
 
Old 01-13-2009, 07:29 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Classic ftp does not move directories with contents. There are however, user-friendly GUI frontends that do this. (I've never used one on Linux)

Never tried this with wget....Do you have to know the pathname up front, or can you browse in the same way as you can with ftp?
 
Old 01-13-2009, 07:33 PM   #5
DropSig
Member
 
Registered: Apr 2004
Location: Saskatchewan
Distribution: Ubuntu, Centos
Posts: 208

Rep: Reputation: 30
With wget you need the exact path.
Its a good way to quickly get a file when you the where it is, but it is non interactive.
 
Old 01-13-2009, 08:06 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Have you looked at the mget/mput cmds in ftp?
 
Old 01-14-2009, 01:55 AM   #7
h725
Member
 
Registered: Apr 2008
Posts: 114

Original Poster
Rep: Reputation: 15
Hi all,
the problem is: I need to UPLOAD file
And from the man page of "ftp":
Note:
mget and mput are not meant to transfer entire directory subtrees of files. That can be done
by transferring a tar(1) archive of the subtree (in binary mode).
 
Old 01-14-2009, 02:58 AM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
the problem is: I need to UPLOAD file
ncftpput
 
Old 01-14-2009, 07:11 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by h725 View Post
Hi all,
the problem is: I need to UPLOAD file
And from the man page of "ftp":
Note:
mget and mput are not meant to transfer entire directory subtrees of files. That can be done
by transferring a tar(1) archive of the subtree (in binary mode).
It seems you have pretty much answered your own question......

The various user-friendly GUI clients I have used will transfer directories and files both ways---basic command-line ftp will not.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP / Command line ftp quesion 200mg Linux - Server 4 05-06-2008 03:21 PM
FTP Command Line (Scripting Multiple FTP gets) Critcho Linux - Software 3 01-04-2007 11:57 PM
what is different with Ftp From browser and Ftp from command line zahra79 Linux - Networking 2 06-22-2005 03:26 AM
Command Line FTP erikcw Fedora 3 10-12-2004 09:44 AM
FTP Question. Setup from SSH command line Aen Linux - Newbie 5 08-22-2003 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:26 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