Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How do I execute FTP commands on one line?

I have the following FTP client conversation:

variscite@variscite-desktop:~$ ftp 192.168.100.10
Connected to 192.168.100.10.
220 (vsFTPd 2.3.5)
Name (192.168.100.10:variscite): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> get hello hello
local: hello remote: hello
200 PORT command successful. Consider using PASV.                                                                       
150 Opening BINARY mode data connection for hello (7796 bytes).                                                         
226 Transfer complete.                                                                                                  
7796 bytes received in 0.01 secs (702.8 kB/s)                                                                           
ftp> exit                                                                                                               
221 Goodbye. 

Is it possible to do this in one command, or write a shell script which does the same? Client computer is Ubuntu 12.04, and I need to do this without installing additional packages.

share|improve this question

marked as duplicate by Rinzwind, Ringtail, belacqua, Javier Rivera, hexafraction Nov 7 '12 at 21:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I never tried this with FTP, but I think you just need to specify these commands in a bash file. –  Evandro Silva Nov 7 '12 at 13:21
    
@Rinzwind - I cannot use the answer to this question, because lftp is not available. –  Alex Farber Nov 7 '12 at 13:42
    
Ok :) do you have scp? I always use scp for this. –  Rinzwind Nov 7 '12 at 13:45
    
@Rinzwind - yes, scp is available. –  Alex Farber Nov 7 '12 at 13:46
add comment

1 Answer 1

up vote 1 down vote accepted

While I agree that scp is better, it's not only that your client needs the scp command, your server needs to support that as well ofcourse. Enough situations where you can just reach the server through FTP, isn't there?

If you want to get a file from FTP you could just use wget ?

wget ftp://username:password@SERVERNAME/directory/file
share|improve this answer
    
wget ftp://anonymous:@192.168.100.10/hello - got it working. Thanks. –  Alex Farber Nov 7 '12 at 14:31
    
I added also chmod +x hello since this is executable. –  Alex Farber Nov 7 '12 at 14:32
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.