Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What would be the fastest way to recursively retrieve entire directory listing from an ftp server using wget/curl/whatever? I don't need to download any files, just directory and file names. Basically what ls -R does.

share|improve this question

The best I can do with wget is

wget -r --spider --no-remove-listing

Which will create empty directories containing a .listing file with the listing of the matching directory on the ftp server, and take forever.

You'll probably need to use a real ftp client like lftp:

lftp -e "find;quit" > listing.txt
share|improve this answer
wget -r
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.