Small Printed Circuit Board

Code, Docs & Tools

Full site download via FTP using wget


If you need to fully download a website via FTP form the command line, you can do it using the wget command.

$ wget -r --ftp-user=username --ftp-password=password -l 25

In the above example, you have to replace username and password with the FTP account's username and password. The -r switch tells wget to retrieve files and directories recursively: the default maximum depth is 5, but this limit is increased to 25 wth the -l 25 switch.

Then you have to set the correct hostname and optionally the starting directory.

This will download all the files available in the FTP space locally.

wget has indeed many other parameters: please refer to its manpage (man wget) for the full list.