Linux ftp:名称或服务未知

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18090006/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 00:28:53  来源:igfitidea点击:

ftp: Name or Service not known

linuxftpsftpunknown-host

提问by Scicare

in command line

在命令行中

> ftp ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/

Work on one computer but does not work on my other one. Error returned

在一台计算机上工作,但在我的另一台计算机上不起作用。返回错误

ftp: ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/: Name or service not known

ftp:ftp: //ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/:名称或服务未知

I also tried the raw IP address which is

我还尝试了原始 IP 地址

> ftp ftp://130.14.250.10/1000genomes/ftp/data/

But it didn't work.

但它没有用。

What is the problem here? how can I fix this?

这里有什么问题?我怎样才能解决这个问题?

采纳答案by Joni

The ftp command accepts the server name, not a URL. Your session likely should look like:

ftp 命令接受服务器名称,而不是 URL。您的会话可能应如下所示:

ftp ftp-trace.ncbi.nih.gov
(Server asks for login and password)
cd /1000genomes/ftp/data/
mget *

回答by Lochemage

It looks to me like the computer that isn't working is already adding the ftp:to the URL, have you tried removing it from yours and seeing if that works?

它看起来对我这样没有工作已添加计算机ftp:的URL,你尝试从你删除它,看是否可行?

> ftp ftp-trace.ncbi.nih.gov/1000genomes/ftp/data

回答by Ursula

This depends on the ftp client you are using. On Mac OSX (ftp client from BSD), for example, the default command line ftp client accepts the full url, while for example in CentOS the default client doesn't, and you need to connect just to the hostname. So, it depends on the flavor of linux and the installed default ftp client.

这取决于您使用的 ftp 客户端。例如,在 Mac OSX(来自 BSD 的 ftp 客户端)上,默认命令行 ftp 客户端接受完整 url,而例如在 CentOS 中,默认客户端不接受,您只需要连接到主机名。因此,这取决于 linux 的风格和安装的默认 ftp 客户端。

Default ftp client in CentOS (ARPANET):

CentOS (ARPANET) 中的默认 ftp 客户端:

ftp ftp-trace.ncbi.nih.gov
cd 1000genomes/ftp/data

If you want to use the full url in CentOS 5.9 or Fedora 18 (where I tested it), you could install an additional ftp client. For example ncftp and lftp have the behavior you are looking for.

如果您想在 CentOS 5.9 或 Fedora 18(我在其中测试过)中使用完整 url,您可以安装额外的 ftp 客户端。例如 ncftp 和 lftp 具有您正在寻找的行为。

ncftp, available through yum or your favorite package manager:

ncftp,可通过 yum 或您最喜欢的包管理器获得:

 ncftp ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/
 NcFTP 3.2.2 (Aug 18, 2008) by Mike Gleason (http://www.NcFTP.com/contact/).
 Connecting to ...
 ...
 Logged in to ftp-trace.ncbi.nih.gov.
 Current remote directory is /1000genomes/ftp/data

lftp, also available through your favorite package manager:

lftp,也可以通过您最喜欢的包管理器获得:

 lftp ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/
 cd ok, cwd=/1000genomes/ftp/data                                         
 lftp ftp-trace.ncbi.nih.gov:/1000genomes/ftp/data> 

Another, more efficient, way to retrieve a page, is using wget or curl. These work for http, ftp and other protocols.

另一种更有效的检索页面的方法是使用 wget 或 curl。这些适用于 http、ftp 和其他协议。