![]() ![]() If we want to make the links suitable for local inspection, we can utilize the option –convert-links. Let’s make sure to keep the –no-parent (- np) option if downloading the parent directory is not desired. Let’s see the complete command: $ wget -r -np -nH -cut-dirs=1 And with the value 2, we get web/ and so on. ![]() By setting this second option to 1, we attain category/web. Moreover, by setting the value of –cut-dirs, we can use this directory trick further. However, when we add the option -nh, we get linux/category/web directory path. With these options, we can manipulate the recursive retrieving of the directories.įor example, if we only use the option -r to download the subdirectories of we end up with 4 directories directly. The second option –cut-dirs, on the other hand, specifies the number of directory components to be ignored. ![]() nh option disables the directories that are prefixed by the hostname. The first way to achieve our goal with wget is by using the options –no-host-directories (-nh) and –cut-dirs. Downloading Desired Directories Recursively Please note that this operation will take some time and memory since it is trying to download the entire website. Reusing existing connection to HTTP request sent, awaiting response. w get gives us the ability to mirror everything with the option –mirror, -m: $ wget -m First, we’re going to look at how to download the whole website. ![]()
0 Comments
Leave a Reply. |