如何在Linux中递归搜索FTP服务器?适配DD-WRT固件更新场景
Great question—dealing with FTP repositories when Google’s results fall short is super frustrating, especially for something as critical as keeping your router’s firmware up to date. Let’s break down a few reliable, actionable methods to recursively browse and search the dd-wrt FTP server tailored to your needs:
1. Use Command-Line FTP Tools (Fast & Flexible)
Command-line tools are perfect for quick recursive searches without extra software bloat. Two top options:
lftp (Best for Interactive Search)
lftp is a powerful command-line FTP client with built-in recursive search capabilities. Here’s how to use it:
- First, install lftp (on Linux:
sudo apt install lftp; on macOS use Homebrew:brew install lftp; Windows can use WSL or download a pre-built binary). - Connect to the DD-WRT FTP server:
lftp ftp.dd-wrt.com - Once connected, run a recursive search for your router model (replace
YOUR_ROUTER_MODELwith your actual model, e.g.,RT-AC68U):
This will list all firmware files matching your model. You can also usefind / -name "*YOUR_ROUTER_MODEL*" -type fls -R /downloads/router/to recursively list the entire router firmware directory structure if you prefer browsing manually. - If you want to download a specific directory (e.g., all files for your model), use the
mirrorcommand:mirror /downloads/router/Brand/YourModel/ ./local-ddwrt-firmware/
wget (For Recursive Download & Local Search)
If you’d rather download a subset of the FTP tree to search locally (which is faster for repeated lookups), use wget:
wget -r --no-parent --reject="index.html*" ftp://ftp.dd-wrt.com/downloads/router/Brand/YourModel/
-renables recursive download--no-parentprevents wget from climbing up to parent directories--rejectskips any auto-generated index files (if present)
Once downloaded, you can use your system’s local search tool (likegrepor Spotlight) to find specific firmware versions.
2. GUI FTP Clients (User-Friendly)
If you prefer a graphical interface, these clients make recursive browsing and search straightforward:
- FileZilla: Connect to
ftp.dd-wrt.com(anonymous login works). Right-click any directory (start with/downloads/router/) and select Search files. Check the Recursive box, enter your router model, and hit search. You can also expand directories manually to browse the tree. - WinSCP: Use the Search feature (Ctrl+F) with the All subfolders option enabled. It also supports syncing local directories with the FTP server if you want to keep a local copy.
- Cyberduck: Connect via FTP, right-click a folder, and choose Search to run a recursive search through subdirectories.
3. Pro Tips to Speed Up Your Search
- Know the FTP Structure: DD-WRT organizes firmware under
/downloads/router/[Brand]/[Model]/, so start by navigating to your router’s brand directory first—this narrows your search drastically instead of scanning the entire server. - Check Version Subdirectories: Many models have separate folders for stable, beta, or older firmware versions (e.g.,
stable/,beta/), so don’t overlook those if you need a specific release. - Anonymous Login: You don’t need a username/password for ftp.dd-wrt.com—just use anonymous login when prompted.
内容的提问来源于stack exchange,提问作者Kyle H

