Skip to main content

The Windows Command-Line FTP Client

The Windows Command-Line FTP Client

This tutorial walks the user through the basics of the command-line FTP client built into most Windows operating systems.
Sections of this project:
  1. Invoking and Quitting the FTP Client
  2. Connecting to a Server
  3. Changing Directories
  4. Changing the Transfer Mode
  5. Putting Files
  6. Getting Files
  7. Closing and Quitting
  8. Command-Line Arguments

Introduction

Most of us who use FTP to transfer files have a favorite graphical client, like WS_FTPCuteFTP or the client built into Dreamweaver. With powerful software like this available, it’s easy to forget that Windows has its own—albeit text-based—client.
But if you have never used the command-line FTP client on Windows, you should take a moment to follow this tutorial and familiarize yourself with it. You never know when you’ll find yourself on a strange computer, needing to upload a file.

Invoking and Quitting the FTP Client

There are two primary ways to start the FTP client: from the Command Prompt and from the Start Menu’s Run feature.

Using: 
The Command Prompt can be reached from the Start --> Programs menu. The prompt will show your present working directory, which should look something like:C:\Documents and Settings\username>
Enter ftp at this prompt. You will see the prompt change from your present working directory to:
ftp>
You are now ready to connect to a remote server and transfer files.
While you have FTP running, enter help to bring up a list of available commands that can be used. To learn more about a command, type help command.
To end the FTP session, type quit.
Using: 
To use the Run feature to access FTP, first locate it on the Start Menu and click once.
When the Run window appears, enter ftp and click OK. A Command Prompt window will appear with FTP already running.

Connecting to a Server

At the ftp> prompt, type open hostname where hostname is the domain name or numerical IP address of the remote server (e.g. open troybrophy.com).
If you have entered a valid hostname you should eventually see the greeting, Connected tohostname. When the FTP server is ready it will notify you, and then ask for the account’s username, followed by the password.
Bear in mind that although you can see what you have typed for a username, the window will not echo back password keystrokes, so you will not see your password as you type it.
(In the example above, you see User (troybrophy.com:(none)): troy. The :(none) refers to the fact that no specific port number was entered at the time of connect. Most FTP servers use ports 20 or 21, but if your remote server is configured differently you can specify a connection port with open hostname:port.)

Changing Directories

Now that you are connected to your remote server, you will want to transfer files to specific directories. Bear in mind that the FTP server will start you in the home directory for your account. This may not be the directory where you want to place your files.
Use the pwd (present working directory) command to determine which directory you are in on the remote host.
Use the ls command to list all files and subdirectories in the present working directory.
To change to a new directory, use the cd command (or the lcd command to affect your local machine), followed by the name of the directory to change to:
cd public_html
Changes to a subdirectory called public_html
cd ..
Changes to the parent directory (goes 'back out' of a directory to the one above it)
cd public_html/images/backgrounds
Changes to the directory called backgrounds, which is a subdirectory of images, a subdirectory of public_html
lcd "c:\Program Files"
Changes the working directory on the local machine to Program Files

Changing the Transfer Mode

Once you have located the target directory on the remote server, you can begin the process of uploading (or downloading) files. At this point it is a good idea to set the file transfer mode. This tells the FTP client whether to send the file as ASCII text or as a binary.
If you are uploading images, multimedia, database data or executable files, you will want to toggle the transfer mode to Binary. This is done simply by issuing the command: binary
Likewise, for all text-based and script files (HTML, PHP, CSS style sheets, etc.) you should issue the command: ascii
ASCII is the default setting, but you can always check which mode is set by using the statuscommand.

Putting Files

The command used to upload a file to a remote directory is put:
put index.html
Uploads the file index.html from your local machine to the remote server if the file exists in your local directory (or if you used the lcd command to change to the local directory where the file lives)
put "c:\websites\index.html"
Uploads the file index.html from a directory other than the current local directory connected to the FTP client
put *
Uploads all files from the current local directory to the present work directory on the remote server

Getting Files

The get command retrieves files from the remote server and places them in your current local directory. It works the same way as the put command. Remember to set the transfer mode before getting files.
get index.html
Downloads the file index.html to your local machine from the remote server
get images/backgrounds/stripes.png
Downloads the file stripes.png from the subdirectory of a subdirectory of the present working directory
get *.png
Downloads all files in the present working directory that have the .png extension

Closing and Quitting

When you have finished with the FTP client, first close the connection to the remote server by issuing the close command.
You can then type quit to exit the FTP client.

Command-Line Arguments

Like most command-prompt programs, the FTP client accepts arguments when it is invoked. In other words, you can attach more information to the command used to start the FTP client. This information can include the name of the server you want to connect to.
For example, entering the following line at the Command Prompt:
ftp troybrophy.com
will open the FTP client, and immediately connect to the remote server troybrophy.com.
For a complete list of arguments that FTP will accept, start the client and type help

Comments

Popular posts from this blog

Oracle Import getting stuck Processing object type SCHEMA_EXPORT/

Oracle Import getting stuck Processing object type SCHEMA_EXPORT/ /database1/rdbm6/export> tail -200f impdp_D.SPORTS_03192012.log ;;; Import: Release 11.2.0.2.0 - Production on Mon Mar 19 15:34:10 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved. ;;; Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table "SYS"."SYS_IMPORT_FULL_02" successfully loaded/unloaded Starting "SYS"."SYS_IMPORT_FULL_02":  "/******** AS SYSDBA" REMAP_SCHEMA=SPORTS:SPORTS DIRECTORY=dpump_dir DUMPFILE=expdp_D.SPORTS_02282012.dmp LOGFILE = impdp_D.SPORTS_03192012.log REMAP_TABLESPACE = SPORTS_DATA_TS:SPORTS_DATA_TS , SPORTS_INDEX_TS:SPORTS_INDEX_TS Processing object type SCHEMA_EXPORT/USER ORA-31684: Object type USER:"SPORTS" already exists Processing object type SCHEMA_EXPORT/ROLE_GRANT Proc

ORA-06550, WMSYS.LT_EXPORT_PKG.schema_info_exp

When you do full database export it fails will following errors as below. Export: Release 11.2.0.1.0 - Production on Mon Sep 30 12:04:38 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved. ;;; Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Starting "SYS"."SYS_EXPORT_SCHEMA_01":  /******** AS SYSDBA schemas=user1 directory=data_pump_dir dumpfile=user1.dmp logfile=user1.log Estimate in progress using BLOCKS method... Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 0 KB Processing object type SCHEMA_EXPORT/USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE ORA-39127: unexpected error from call to export_string :=WMSYS.LT_EXPORT_PKG.schema_info_exp('user1&

How to make the email Address Dummy in Oracle Database?

How to make the email Address Dummy in Oracle Database? Query to make the email Address as dummy, update <tablename> set <Columnname> = '@' || <Columnname> where <Columnname>  is not null; Query to Remove the email Address as dummy, update <tablename> set <Columnname>= substr(<Columnname>,2,length(<Columnname>)) where <Columnname> is not null;