Ftp: name or service unknown

on the command line

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

Work on one computer, but do not work on another. Error returned

ftp: ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/data/ : unknown name or service

I also tried the raw IP address, which

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

But that did not work.

What is the problem? how can i fix this?

+8
linux ftp sftp unknown-host
source share
3 answers

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

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

It depends on the ftp client you are using. For example, on Mac OSX (the ftp client from BSD), the ftp client uses the ftp client by default, while, for example, on CentOS, the client does not do this by default, and you only need to connect to the host name. Thus, it depends on the taste of linux and the default ftp client installed.

The default ftp client on CentOS (ARPANET):

 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 can install an additional ftp client. For example, ncftp and lftp have the behavior you are looking for.

ncftp available via yum or your favorite package manager:

  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 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 get a page is to use wget or curl. They work for http, ftp and other protocols.

+3
source share

It seems to me that a computer that does not work already adds ftp: to the URL, did you try to remove it and see if it works?

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

All Articles