Monday, October 08, 2007

Using Mac OS X - Terminal as FTP client


Mac OS X - Terminal, originally uploaded by mo_mughrabi.

Many people don't realize the power of having access to command-line prompt. Recently, Apple has released all its Mac OS included an access to the command-line and since Mac OS is a Unix based this makes all the difference.

Now, if you want to use the terminal (shell, command-line) as your FTP client there is few things we should demonstrate here.

First of all, you will need to know the following information in order for you to access the FTP server. Host name (Domain name or IP address), username & Password. Now, Open your terminal and write to following command:

ftp kwtmac.com
Connected to kwtmac.com.
220 FTP Server (A+Net) ready


In the next step you will be asked to enter you username then you will be asked to enter the password. Once you get the below message that means you are logged in:

230 User mughrabi logged in
Remote system type is UNIX.
Using binary mode to transfer files.


here are some useful commands you can use once you are logged in:
1. ls = can be used to list the files within the directory.
2. pwd = will show you your current location
3. cd = will allow you to get inside and outside folders.
4. get = followed by the file name, this will download the file from the FTP server.
5. put = followed by the file name, this will upload the file to the FTP server.
6. lcd = this will allow you to specify the directory where you want downloaded files to be placed and uploaded files to be picked up from.


I believe an example will help to understand better, lets say we have a folder "TEST" and there is this file "mo.php" you want to download and then you want to upload "info.php" which is on your desktop.

cd TEST
ls
get mo.php
lcd /Users/Mughrabi/Desktop
put info.php
quit


This basic steps will allow you to access your FTP server, list files and folders, browse in and out from folders and download/upload files. Enjoy using your built-in command line interface and if you have any further questions please feel free to put them on.

UPDATE: Another copy of this blog entry is posted on kwtmac.com ( http://www.kwtmac.com/2007/10/08/using-mac-os-x-terminal-as-ftp-client/ )

The new desk


three macs and me desk, originally uploaded by mo_mughrabi.

Having a new desk is working for my advantage; the worst part of buying furniture from IKEA is that you have to build it once you get back home. I spent the entire evening with my brother putting this thing together.

Lately, I've been more organized than I use to be. I believe it has to do with the new thing am doing nowadays; I've decided to start writing my to-do's on a note book. And every time I remember something I'll write it there, on the first day I end up writing 2 pages of to-do. And it’s really working good, every day I take a look at what is left and work on them. Right now, I almost have one page already scratched as done.