Apple - How can I connect to ftp server in terminal?

ftp hostname

or

ftp://username:password@hostname

Now, once connected the 5 most common options are:

cd foldername      #e.g. cd /downloads/recent
get filename       #e.g. get thisisthefileiwant.text
put filename       #e.g. put sendthistotheserver.txt
mget filenameregex #e.g mget * to get every file in a directory
mput filemameregex #e.g. mput *.txt to upload every txt file to the server

The only trickery is sometimes you might need to put it into binary mode by typing binary

To exit, type bye

The difference between mine and @grgarside 's solution is his forks it to the Finder using open, while mine uses Terminal


ftp
open ftp://username:password@hostname

These are two separate commands. The open command is run within ftp.


I know that this topic is quiet old but I found it accidentally and maybe someone other will visit this site too. ftp command no longer works for High Sierra and higher. https://discussions.apple.com/thread/8095899

Tags:

Terminal

Ftp