如何获得ftp dir输出?

sh/bash/dash/ksh/zsh等Shell脚本
回复
罗非鱼
帖子: 980
注册时间: 2008-04-12 12:44

如何获得ftp dir输出?

#1

帖子 罗非鱼 » 2010-09-09 9:20

我使用ftp命令登陆一个服务器后,
dir /dd
可以列出dd目录下面的所有文件,请问,如何将这个
输出,存放在我指定的目录?
dir /dd > /home/myfile
这个命令不起作用了。
罗非鱼
帖子: 980
注册时间: 2008-04-12 12:44

Re: 如何获得ftp dir输出?

#2

帖子 罗非鱼 » 2010-09-09 9:55

我找到了答案
ftp> ls /aa /home/pt/myfile
output to local-file: /home/pt/myfile?
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
还有个问题,需要解决,如何不让它输出?,让我回车后再执行命令,
就是,命令输完后,它就立即执行,不要我干预。
tusooa
帖子: 6548
注册时间: 2008-10-31 22:12
系统: 践兔
联系:

Re: 如何获得ftp dir输出?

#3

帖子 tusooa » 2010-09-09 22:00

代码: 全选

ftp serv-host > file

代码: 全选

] ls -ld //
tomato007
帖子: 1
注册时间: 2012-04-22 21:33

Re: 如何获得ftp dir输出?

#4

帖子 tomato007 » 2012-04-22 21:35

哥们,跟着你的帖子,没有弄出来,能指点一下吗?
回复