Tag: curl

curl download file from ftp with user and password

me@MacBook:~/Downloads$ curl -OLv -u myusername:mypassword ftp://myftphost/myfile
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying myftpip...
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to myftphost (myftpip) port 21 (#0)
< 220 FTP server ready
> USER myusername
< 331 Password required for myusername
> PASS mypassword
< 230 User myusername logged in
> PWD
< 257 "/" is the current directory
* Entry path is '/'
> EPSV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
< 229 Entering Extended Passive Mode (|||44363|)
* Trying myftpip...
* Connecting to myftpip (myftpip) port 44363
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0* Connected to myftphost (myftpip) port 21 (#0)
> TYPE I
< 200 Type set to I
> SIZE myfile
< 213 173938503
> RETR myfile
< 150 Opening BINARY mode data connection for myfile (173938503 bytes)
* Maxdownload = -1
* Getting file with size: 173938503
{ [1448 bytes data]
99 165M 99 164M 0 0 3881k 0 0:00:43 0:00:43 --:--:-- 3925k* Remembering we are in dir ""
< 226 Transfer complete
100 165M 100 165M 0 0 3885k 0 0:00:43 0:00:43 --:--:-- 4004k
* Connection #0 to host myftphost left intact