Basic FTP Commands

本文详细介绍了FTP(文件传输协议)的基本概念、工作原理、使用方法及常见命令,包括如何连接远程计算机、进行匿名登录、复制文件以及退出FTP环境等操作。同时,提供了两种FTP会话示例,帮助读者更好地掌握FTP的实践应用。
 

What is FTP?

The FTP ( File Transfer Protocol) utility program is commonly used for copying files to and from other computers. These computers may be at the same site or at different sites thousands of miles apart. FTP is a general protocol that works on UNIX systems as well as a variety of other (non-UNIX) systems.

For the purposes of this Web page, the local machine refers to the machine you are initially logged into, the one on which you type the ftp command. The remote machine is the other one, the one that is the argument of the ftp command.

A user interface for the standard File Transfer Protocol for ARPANET, FTP acts as an interpreter on the remote machine. The user may type a number of UNIX-like commands under this interpreter to perform desired actions on the remote machine.

Most operating systems and communication programs now include some form of an FTP utility program, but the commands differ slightly between them. The following explanations and alphabetical list of commands refers to the common FTP utility program as provided on a UNIX machine. Check the documentation for your own machine to determine the comparable commands.

Most computers today include a windows-based type FTP program that is more PC-oriented and does not require full knowledge of these commands.
You can also perform FTP through a browser. For example, bring up Internet Explorer and type in

            ftp://yourLoginName@IPaddress

instead of a normal web page URL.

The FTP site of the Computer Science department at CSU requires the user to usesftp, the secure version of FTP. Just type sftp instead offtp, when you are using FTP in a terminal window.


Getting Started

To connect your local machine to the remote machine, type

            ftp machinename

where machinename is the full machine name of the remote machine, e.g.,purcell.cs.colostate.edu. If the name of the machine is unknown, you may type

            ftp machinennumber

where machinennumber is the net address of the remote machine, e.g., 129.82.45.181. In either case, this command is similar to logging onto the remote machine. If the remote machine has been reached successfully, FTP responds by asking for aloginname and password.

When you enter your own loginname and password for the remote machine, it returns the prompt

            ftp>

and permits you access to your own home directory on the remote machine. You should be able to move around in your own directory and to copy files to and from your local machine using the FTP interface commands given on the following page.


Anonymous FTP

At times you may wish to copy files from a remote machine on which you do not have a loginname. This can be done using anonymous FTP.

When the remote machine asks for your loginname, you should type in the word anonymous. Instead of a password, you should enter your own electronic mail address. This allows the remote site to keep records of the anonymous FTP requests.

Once you have been logged in, you are in the anonymous directory for the remote machine. This usually contains a number of public files and directories. Again you should be able to move around in these directories. However, you are only able to copy the files from the remote machine to your own local machine; you are not able to write on the remote machine or to delete any files there.


Common FTP Commands

?to request help or information about the FTP commands
asciito set the mode of file transfer to ASCII
(this is the default and transmits seven bits per character)
binaryto set the mode of file transfer to binary
(the binary mode transmits all eight bits per byte and thus provides less chance of a transmission error and must be used to transmit files other than ASCII files)
byeto exit the FTP environment (same as quit)
cdto change directory on the remote machine
closeto terminate a connection with another computer
 close brubeckcloses the current FTP connection with brubeck,
  but still leaves you within the FTP environment.
deleteto delete (remove) a file in the current remote directory (same asrm in UNIX)
getto copy one file from the remote machine to the local machine
 get ABC DEFcopies file ABC in the current remote directory to (or on top of) a file namedDEF in your current local directory.
 get ABCcopies file ABC in the current remote directory to (or on top of) a file with the same name,ABC, in your current local directory.
helpto request a list of all available FTP commands
lcdto change directory on your local machine (same as UNIX cd)
lsto list the names of the files in the current remote directory
mkdirto make a new directory within the current remote directory
mgetto copy multiple files from the remote machine to the local machine;
  you are prompted for a y/n answer before transferring each file
 mget *copies all the files in the current remote directory to your current local directory, using the same filenames. Notice the use of the wild card character,*.
mputto copy multiple files from the local machine to the remote machine;
  you are prompted for a y/n answer before transferring each file
opento open a connection with another computer
 open brubeckopens a new FTP connection with brubeck;
  you must enter a username and password for a brubeck account
      (unless it is to be an anonymous connection).
putto copy one file from the local machine to the remote machine
pwdto find out the pathname of the current directory on the remote machine
quitto exit the FTP environment (same as bye)
rmdirto to remove (delete) a directory in the current remote directory


Further Information

Many other interface commands are available. Also FTP can be run with different options. Please refer to your manual or the UNIX man page on ftp for more information. <!--

See also the SILS FTP Tutorial-->


Example Sessions

Examples of two FTP sessions are given on the next two pages. These show the type of interaction you may expect when using theftp utility.


Example of Anonymous FTP Session

%   ftp cs.colorado.edu  
Connected to cs.colorado.edu.  
220 bruno FTP server (SunOS 4.1) ready.  
Name (cs.colorado.edu:yourlogin): anonymous  
331 Guest login ok, send ident as password.  
Password:  
230-This server is courtesy of Sun Microsystems, Inc.  
230-  
230-The data on this FTP server can be searched and accessed via WAIS, using  
230-our Essence semantic indexing system.  Users can pick up a copy of the  
230-WAIS ".src" file for accessing this service by anonymous FTP from  
230-ftp.cs.colorado.edu, in pub/cs/distribs/essence/aftp-cs-colorado-edu.src  
230-This file also describes where to get the prototype source code and a  
230-paper about this system.  
230-  
230-  
230 Guest login ok, access restrictions apply.  
ftp> cd /pub/HPSC  
250 CWD command successful.  
ftp> ls  
200 PORT command successful.  
150 ASCII data connection for /bin/ls (128.138.242.10,3133) (0 bytes).  
ElementsofAVS.ps.Z  
   . . .
execsumm_tr.ps.Z  
viShortRef.ps.Z  
226 ASCII Transfer complete.  
418 bytes received in 0.043 seconds (9.5 Kbytes/s)  
ftp> get README  
200 PORT command successful.  
150 ASCII data connection for README (128.138.242.10,3134) (2881 bytes).  
226 ASCII Transfer complete.  
local: README remote: README  
2939 bytes received in 0.066 seconds (43 Kbytes/s)  
ftp> bye  
221 Goodbye.  
%   ls  
   . . .
README    
   . . .
An FTP session to obtain the HPSC README file from the cs.colorado.edu anonymous ftp directory using aloginname of anonymous and a password of one's own electronic mail address.


Example of Regular FTP Session

%   ftp nordsieck.cs.colorado.edu  
Connected to nordsieck.cs.colorado.edu.  
220 nordsieck FTP server (Version 5.53 Tue Aug 25 10:46:12 MDT 1992) ready.  
Name (nordsieck.cs.colorado.edu:yourlogin): yourlogin  
331 Password required for yourlogin.  
Password:  
230 User yourlogin logged in.  
ftp> cd HPSC/exercises  
250 CWD command successful.  
ftp> ls  
200 PORT command successful.  
550 No files found.  
ftp> put tmul.out  
200 PORT command successful.  
150 Opening ASCII mode data connection for tmul.out.  
226 Transfer complete.  
local: tmul.out remote: tmul.out  
1882 bytes sent in 0.0095 seconds (1.9e+02 Kbytes/s)  
ftp> ls  
200 PORT command successful.  
150 Opening ASCII mode data connection for file list.  
tmul.out  
226 Transfer complete.  
9 bytes received in 0.0021 seconds (4.3 Kbytes/s)  
ftp> mput *  
mput Makefile? y  
200 PORT command successful.  
150 Opening ASCII mode data connection for Makefile.  
226 Transfer complete.  
local: Makefile remote: Makefile  
1020 bytes sent in 0.0062 seconds (1.6e+02 Kbytes/s)  
mput tmul.out? n  
ftp> quit  
221 Goodbye.  
%   ls  
   . . .
Makefile    
tmul.out    
   . . .
An FTP session to copy files from a remote machine back to nordsieck.cs.colorado.edu using one's own login and password.

转载地址: http://www.cs.colostate.edu/helpdocs/ftp.html
内容概要:本文系统阐述了企业新闻发稿在生成式引擎优化(GEO)时代下的全渠道策略与效果评估体系,涵盖当前企业传播面临的预算、资源、内容与效果评估四大挑战,并深入分析2025年新闻发稿行业五大趋势,包括AI驱动的智能化转型、精准化传播、首发内容价值提升、内容资产化及数据可视化。文章重点解析央媒、地方官媒、综合门户和自媒体四类媒体资源的特性、传播优势与发稿策略,提出基于内容适配性、时间节奏、话题设计的策略制定方法,并构建涵盖品牌价值、销售转化与GEO优化的多维评估框架。此外,结合“传声港”工具实操指南,提供AI智能投放、效果监测、自媒体管理与舆情应对的全流程解决方案,并针对科技、消费、B2B、区域品牌四大行业推出定制化发稿方案。; 适合人群:企业市场/公关负责人、品牌传播管理者、数字营销从业者及中小企业决策者,具备一定媒体传播经验并希望提升发稿效率与ROI的专业人士。; 使用场景及目标:①制定科学的新闻发稿策略,实现从“流量思维”向“价值思维”转型;②构建央媒定调、门户扩散、自媒体互动的立体化传播矩阵;③利用AI工具实现精准投放与GEO优化,提升品牌在AI搜索中的权威性与可见性;④通过数据驱动评估体系量化品牌影响力与销售转化效果。; 阅读建议:建议结合文中提供的实操清单、案例分析与工具指南进行系统学习,重点关注媒体适配性策略与GEO评估指标,在实际发稿中分阶段试点“AI+全渠道”组合策略,并定期复盘优化,以实现品牌传播的长期复利效应。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值