Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

The best I can do with wget is

wget -r --spider --no-remove-listing ftp://ftp.example.com/

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" ftp://ftp.example.com/ > listing.txt
share|improve this answer
wget -r ftp://your.site.com/
share|improve this answer

Your Answer

 
discard

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.