Command Line FTP


For those people that access the internet from a computer that isn't their own, where no FTP software is installed and where they aren't allowed to install any, and for old DOSor UNIX freaks ;), command line FTP is a quick, low-resource, but not all too comfortable substitute. In addition, commandline FTP helps you to understand the general principles of FTP so that you can set up any FTP client easily and helps with troubleshooting as you get to see the response of the server directly.
Windows95 and NT as well as most UNIXes have FTP installed by default. However, you have to know a few commands which are a strange mixture of DOS and UNIX commands.

Connecting

Open a command prompt (UNIX: terminal) and go to the directory where the files you want to upload are stored - or where the files you want to download shall go. This is the local current directory, as opposed to the remote current directory, i.e. the one on the Geocities server. It is important to understand that once you've connected to the FTP server, you are at once in a certain remore directory the contents of which you can see and change, and in a certain local directory which is hidden for as long as you are connected. Type
ftp ftp.oocities.com
You will be prompted for your username and password - enter them. The server will automatically take you to the directory where your files are stored.

Directory Operations

On the Geo server, you can't go upwards from your directory, but of course you can go to your subdirectories. Directory operations follow the UNIX convention, so instead of backslashes, you use slashes.

cd pictures
takes you to the subdirectory "pictures"

cd ..
takes you one directory up. Note space between cd and ..

cd ../images
takes you one directory up, then down into "images" which is parallel to your current directory

pwd
tells you which directory you are currently in (Print Working Directory)

del pictures
removes the directory "pictures"

File Operations

Before up- or downloading files, you should specify whether you want ASCII or binary mode for the transfer. Geo can't determine it automatically. For HTML, TXT or CSS, ASCII mode is the one to choose, for images, MID etc you should select binary mode. Type
ascii or bin

ls
lists contents of the remote current directory (file names only)

dir
lists contents of the remote current directory, including file size, date/time, ownership and permissions

dir a*
lists all files that begin with "a"

put file.html
uploads the file "file.html" from the local current directory to the remote current directory

put images\file.html
uploads "file.html" from the subdirectory "images" of the local (Win/DOS) current directory (UNIX: slash of course)

mput *.html
uploads all files with the extension "html"

mput a*
uploads all files that start with "a"

mput a???.html
uploads all files where the first letter is "a", then any three letters, then ".html"

get file.html
downloads the file "file.html" from the local current directory to the remote current directory

mget
downloads multiple files with wildcards, like mput

ren file.html file.jpg
renames "file.html" to "file.jpg"

del file.html
deletes "file.html"

Disconnecting

when you're sure you're done, type
bye
The server will then bid you "good bye". If you don't disconnect this way, the next connection might not work properly as you are, from the viewpoint of the server, still connected.


MAIN PAGE | HELP LINKS | HOMEPAGE RESOURCES

This page was prepared by Yoshiwara


This page hosted by  Get your own Free Home Page
1