ftp查看本地目录文件

本文介绍在使用FTP客户端时如何查看本地计算机上的文件目录。当忘记需要上传的具体文件名称时,可通过特定命令在FTP会话中显示本地文件列表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问到一个简单的问题,ftp到远程服务器之后需要上传一个文件,但是我忘记了本地需要上传的文件名,因此需要查看本地目录。

解决方法:

1 lcd到本地目录

2 !ls查看本地目录的内容。

ftp> !ls
1         test.txt
ftp> GUI test found problem of check subscription and following steps,defect 171875 already reported this problem,so reopenedftp> cd /test
550 /test: No such file or directory
ftp> lcd test
test: A file or directory in the path name does not exist.
ftp> lcd /test
Local directory now /test
ftp> !ls
1         test.txt


ftp> cd /test
550 /test: No such file or directory
ftp> lcd test
test: A file or directory in the path name does not exist.
ftp> lcd /test
Local directory now /test
ftp> !ls
1         test.txt
ftp> cd /test
550 /test: No such file or directory
ftp> lcd test
test: A file or directory in the path name does not exist.
ftp> lcd /test
Local directory now /test
ftp> !ls
1         test.txt
ftp> lcd test
test: A file or directory in the path name does not exist.
ftp> lcd /test
Local directory now /test
ftp> !ls
1         test.txt
ftp> !ls
1         test.txt
ftp> GUI test found problem of check subscription and following steps,defect 171875 already reported this problem,so reopenedftp> cd /test
550 /test: No such file or directory
ftp> lcd test
test: A file or directory in the path name does not exist.
ftp> lcd /test
Local directory now /test
ftp> !ls
1         test.txt
ftp> !ls
1         test.txt
ftp> GUI test found problem of check subscription and following steps,defect 171875 already reported this problem,so reopenedftp> cd /test
550 /test: No such file or directory
ftp> lcd test
test: A file or directory in the path name does not exist.
ftp> lcd /test
Local directory now /test
ftp> !ls
1         test.txt

FTP服务器默认目录 FTP命令是Internet用户使用最频繁的命令之一,不论是在DOS还是UNIX操作系统下使用FTP,都会遇到大量的FTP内部命令。熟悉并灵活应用FTP的内部命令,可以大大方便使用者,并收到事半功倍之效。 FTP的命令行格式为:ftp -v -d -i -n -g [主机名],其中 -v显示远程服务器的所有响应信息; -n限制ftp的自动登录,即不使用; .n etrc文件; -d使用调试方式; -g取消全局文件名。 ftp使用的内部命令如下(中括号表示可选项): 1.![cmd[args]]:在本地机中执行交互shell,exit回到ftp环境,如:!ls*.zip. 2.$ macro-ame[args]:执行宏定义macro-name. 3.account[password]:提供登录远程系统成功后访问系统资源所需的补充口令。 4.append local-file[remote-file]:将本地文件追加到远程系统主机,若未指定远程系统文件名,则使用本地文件名。 5.ascii:使用ascii类型传输方式。 6.bell:每个命令执行完毕后计算机响铃一次。 7.bin:使用二进制文件传输方式。 8.bye:退出ftp会话过程。 9.case:在使用mget时,将远程主机文件名中的大写转为小写字母。 10.cd remote-dir:进入远程主机目录。 11.cdup:进入远程主机目录的父目录。 12.chmod mode file-name:将远程主机文件file-name的存取方式设置为mode,如:chmod 777 a.out。 13.close:中断与远程服务器ftp会话(与open对应)。 14.cr:使用asscii方式传输文件时,将回车换行转换为回行。 15.delete remote-file:删除远程主机文件。 16.debug[debug-value]:设置调试方式,显示发送至远程主机的每条命令,如:deb up 3,若设为0,表示取消debug。 17.dir[remote-dir][local-file]:显示远程主机目录,并将结果存入本地文件local-file。 18.disconnection:同close。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

惹不起的程咬金

来都来了,不赏点银子么

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值