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 08-09-2012, 07:31 AM   #1
coolx
LQ Newbie
 
Registered: Aug 2011
Posts: 19

Rep: Reputation: Disabled
FTP command with single line


Hi,
There should be a command that enables upload and download files with a single line command. But I cant remember and couldnt be able to find. How can I do that?

Line should be something like that;

ftp 12.12.12.12 username password > file.txt
 
Old 08-09-2012, 07:32 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,165

Rep: Reputation: 889Reputation: 889Reputation: 889Reputation: 889Reputation: 889Reputation: 889Reputation: 889
^ dont use ftp. you should use scp with keys. e.g.:
Code:
scp user@host.net:/path/to/filename local-file.txt

Last edited by schneidz; 08-09-2012 at 07:33 AM.
 
Old 08-09-2012, 07:50 AM   #3
coolx
LQ Newbie
 
Registered: Aug 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
I think scp use ssh protocol? I can only use ftp. And I need printout that how much time this download or upload happen?
 
Old 08-09-2012, 08:01 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,874

Rep: Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907
probably here you can find some usable tips: http://users.telenet.be/mydotcom/how...ript_linux.htm
 
Old 08-09-2012, 08:17 AM   #5
coolx
LQ Newbie
 
Registered: Aug 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
Thanks pan64 but this page explains with more than one lines. I need to find with a single line.
 
Old 08-09-2012, 09:02 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,874

Rep: Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907Reputation: 2907
scripts, and scripts can be invoked in one line. Or you can define functions and call them....
 
Old 08-09-2012, 09:03 AM   #7
coolx
LQ Newbie
 
Registered: Aug 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
Thanks but there is command like I wrote with single line. I used it but I cant find right now.
 
Old 08-09-2012, 09:20 AM   #8
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
I would recommend the ncftp package.
It has ncftpget and ncftpput in it.
This way you can pass every argument to a commandline.
 
Old 08-09-2012, 09:27 AM   #9
coolx
LQ Newbie
 
Registered: Aug 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
Deadeyes how may I do this? I can install it but is there any sample command?
 
Old 08-09-2012, 11:21 AM   #10
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
Quote:
Originally Posted by coolx View Post
Deadeyes how may I do this? I can install it but is there any sample command?
ncftpget -u user -p password hostnameorip ...

The man page and google should give you enough info.
 
Old 08-09-2012, 04:55 PM   #11
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Rep: Reputation: 42
try using lftp ... works like a charm
 
  


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
[SOLVED] How can I use the command line to split a single-lined XML into a multi-line XML xexers Linux - Software 3 12-09-2010 08:25 AM
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 08:19 PM
Help me in Grep Command + cd command in single line JeiPrakash Linux - Newbie 3 05-27-2008 05:16 AM
a single command the spans more then 1 line bourne Programming 4 11-27-2007 06:50 AM
FTP Command Line (Scripting Multiple FTP gets) Critcho Linux - Software 3 01-05-2007 12:57 AM

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

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