Technology TidBits

Answers to various technical questions on php programming, mysql, linux, and many more categories.
25% off Hosting at HostGator.com:
Use Code techbits25



Why does my ftp file listing stop at 2000 files?

Last updated: 07/03/2009

Some ftp servers limit how many files will display as the result of an "ls" command.  This is to limit the possbility of DOS attacks, I suppose.

If you have more than 2,000 files on your website, or in a specific directory, this can be problematic.  No matter whitch FTP client you use, you'll be limited by this setting.  The real fix is to edit the server configuration, or ask you hosting provider to do so.  Otherwise, you can try a few workarounds, if you are trying to download all the files:

If you have shell access, login and just "tar -cvf file.tar directory_with_lots_of_files"  - this should work and will create 1 file you can download for a backup. 

Using ftp, try to "mget x*", where "x" is a pattern that some files have.  If the result is less than 2,000, you can try a few different patterns (if you know all the filenames in the directory) to eventually download all the files.

By the way, before using mget, turn off the prompting by issuing a "prompt" command.  Otherwise, you'll have to answer "Y" to every single file being downloaded.

 

blog comments powered by Disqus
Have your own Tech-bit to contribute? Submit it here

Other questions in this category:
How can I find out what is taking up all the space on my Linux server?
How can I use 'find' to execute commands on all files found?
How do I figure out how many processors and the speeds, etc. are in my Linux box?
How can I remove DOS linebreaks (^M) from my files?
How can I mirror / backup a set of files via ncftp?
My hostname keeps reverting to localhost (or localhost.localdomain) - how can I permanently fix this?
How can I determine if iptables is blocking traffic to my site?
How can I relocate files from a tar archive with extracting the files?
How can I get a list of files most recently updated / edited?
Some find examples for excluding a directory, and executing commands
Useful script to track spammers connecting to your server
How can I turn off / view my linux firewall using iptables?
How can I split a bit tar file into multiple small files?
How can I exclude some files / directories from a tar file?



Powered by KnowledgebasePublisher 1.1
Host Gator
Content provided by Roberts WebForge, Inc.