How to FTP files using OSX's built-in Terminal -FOR FREE!



Ever had the dire need to FTP a file to a server, and time is of the essence. You know time is short, the client is waiting, and you have to upload that preview to your sever, but how to do I do it, without searching for a 3rd-party app? I need a quick solution, I need it now, and I'm here to help.

All you need is Terminal, and this is what we are going to use. So let's open Terminal by doing the following:

Go to the Finder -> Applications -> Utilities -> Double-click on Terminal

-OR-

Have Tiger? Then Spotlight is your friend. Bring up Spotlight (Command + Space Bar) -> Type in "Terminal" sans Quotes and the first Application hit, click on that.


So you should now have something along the lines of this:



Well lets start with the important stuff, but first make sure you have the following:

  • IP, or address of the FTP that we are going to access. - 127.0.0.1 or ftp://ftp.apple.com for example.

  • Username and Password. If necessary.



Have all the necessary stuff? Well lets put it to use. Make sure you are in the terminal and type ftp and hit Return. You should have now:

ftp>

Now type, open space and the IP of the server or the URL of the server. Hit Return.

ftp> open 192.168.0.100 (replace with your server IP of course, for this how-to I will use 192.168.0.100)

Upon, hitting Return, we will try connecting, and if successful, we will be greeted with something along the lines of..

ftp> open 192.168.0.100
Connected to 192.168.0.100.
220 PowerBook-G4-12.local FTP server (tnftpd 20040810) ready.
Name (192.168.0.100:Sebastian):

Waiting for your input is your given Username, or if you have anonymous access you type in Anonymous. Hit Return. Now we have..

ftp> open 192.168.0.100
Connected to 192.168.0.100.
220 PowerBook-G4-12.local FTP server (tnftpd 20040810) ready.
Name (192.168.0.100:Sebastian): Sebastian
331 Password required for Sebastian.
Password:

As you may have guessed it, we need a password, so input that and hit Return.IF you use Anonymous as your Username in the previous step, an email would be required as password, in the format of test@test.com most of the time.

And we are in..

ftp> open 192.168.0.100
Connected to 192.168.0.100.
220 PowerBook-G4-12.local FTP server (tnftpd 20040810) ready.
Name (192.168.0.100:Sebastian): Sebastian
331 Password required for Sebastian.
Password:
230-
Welcome to Darwin!
230 User Sebastian logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

So lets list the folders in our FTP Server, to do that we type dir and hit Return. You should get a listing of all files and folders.

...
ftp> dir
229 Entering Extended Passive Mode (|||55214|)
150 Opening ASCII mode data connection for '/bin/ls'.
total 32
-rw-r--r-- 1 Sebastia Sebastia 3 May 22 14:25 .CFUserTextEncoding
-rw-r--r-- 1 Sebastia Sebastia 15364 Oct 10 21:56 .DS_Store
drwx------ 10 Sebastia Sebastia 340 Oct 10 21:56 .Trash
-rw------- 1 Sebastia Sebastia 0 Jun 15 21:19 .Xauthority
-rw------- 1 Sebastia Sebastia 8025 Oct 10 21:39 .bash_history
drwxr-xr-x 3 root Sebastia 102 Jun 18 01:23 .emacs.d
drwx------ 6 Sebastia Sebastia 204 Jun 19 18:28 .fluxbox
-rw-r--r-- 1 Sebastia Sebastia 633 Jun 17 23:44 .fonts.cache-1
drwxr-xr-x 15 Sebastia Sebastia 510 May 23 00:31 .jedit
-rw------- 1 Sebastia Sebastia 444 May 29 11:05 .mysql_history
drwx------ 8 Sebastia Sebastia 272 Jul 4 14:49 .pan
...

Lets move into a folder so we can upload some files, to do that we type cd space Name of Folder. Hit Return.

...
ftp> cd Upload
250 CWD command successful.
ftp>
...

As you can see we have successfully got ourselves into the Upload folder. Now lets put some files in there. How do we do that? We type in put space and here's the tricky part: - Drag the file that you want to put in the FTP to the Terminal window! You should now have:

...
ftp> put /Users/Sebastian/Desktop/Picture\ 1.png

Hit Return.

So now we have...

...
ftp> put /Users/Sebastian/Desktop/Picture\ 1.png
local: /Users/Sebastian/Desktop/Picture 1.png remote: /Users/Sebastian/Desktop/Picture 1.png
229 Entering Extended Passive Mode (|||55220|)
150 Opening BINARY mode data connection for '/Users/Sebastian/Desktop/Picture 1.png'.
0% | | 0 0.00 KB/s --:-- ETA
226 Transfer complete.
...


Disregard the scrambled text format, but what it is important is the: 226 Transfer complete.
Congrats, you have uploaded a file to your FTP using Terminal!

How do I make folders to then upload files into it? Easy use mkdir and the name of the folder, then hit Return.
The output..

...
ftp> mkdir test
257 "test" directory created.
...

Remember if you want to upload files into your newly made folder you MUST remember to cd into it!

What other commands can you use?

  • rmdir name of folder - Removes a folder.

  • delete name of file - Deletes a file.

  • quit - Ends your session.


So finally, I hope you find this useful it may not be the solutions, but if you are in need of a fast solution this will do. Matter of fact a lot of people use this method, instead of an FTP client for FTP Access. As for me I prefer this method. Mac Geek hardcore, perhaps, but I like it.

About this entry