How to increase the FTP visible file limits via command line

When working with files within your hosting account, organization is very important. It is good to have files separated among folders so they are all related to one another. Although there is no upper limit for the number of files that can exist in a folder, there is a limit to the number of files that will display either in cPanel or when using an FTP account. This means that if the limit is set to 2000, for example, then any files after the 2000th file will not show, despite them existing on the server.

Having too many files in a folder can be detrimental to the performance of the website, however it is not always feasible to segregate files. This is the case with programs such as ecommerce, which may keep a list of files for products in a single directory. Moving them may not be an option. If you have a VPS or Dedicated account with root access, you can adjust the number of files that are allowed to display via the command line, or shell access.

Increasing the FTP file display limit

  1. Log into your shell account as the root user.
  2. Move to the /etc folder.
  3. Open the pure-ftpd.conf file for editing. For this example, we use the nano command.
    nano pure-ftpd.conf
  4. Scroll through the document and locate the LimitRecursion setting. Below is a sample of this line.
    # ‘ls’ recursion limits. The first argument is the maximum number of
    # files to be displayed. The second one is the max subdirectories depth

    LimitRecursion 2000 8

  5. The first number of the setting is the limit of files that cPanel and FTP will display while the second is the max depth of the subdirectories. Increase the first number to allow more files to be displayed. Below we increase the number from 2000 to 10000.
    # ‘ls’ recursion limits. The first argument is the maximum number of
    # files to be displayed. The second one is the max subdirectories depth

    LimitRecursion 10000 8

  6. Save your file according to the editor used. Using nano, we selected ctrl-X, then Y to commit the changes, then <Enter> to save the file under the same name.
  7. Once the file is saved, you will need to restart the ftp service for the new configuration to take effect. The command for that is below as well as a before and after shot of the number of files displayed in an FTP client. Notice the number of files at the bottom of the images.
    service pure-ftpd restart
    BeforeAfter
    before the limite is changed

    after the display limit has been changed

Was this article helpful? Join the conversation!

Questions about our MailChannels Deployment? We have answers and are here to help!Learn More
+