Home » Questions » Computers [ Ask a new question ]

Make wget convert HTML links to relative after download if -k wasn't specified

Make wget convert HTML links to relative after download if -k wasn't specified

The -k option (or --convert-link) will convert links in your web pages to relative after the download finishes, such as the man page says:

Asked by: Guest | Views: 235
Total answers/comments: 1
Guest [Entry]

"Yes, you can make wget do it. I'd say use wget -nc -k [previous options] [previous url]. -nc is no-clobber. From the man page:

When −nc is specified, this behavior is
suppressed, and Wget will refuse to
download newer copies of file.

And the -k option does the link converting. So, wget starts digging in the remote server, sees all the files you already have, refuses to redownload them, and then edits the HTML links to relative when it's done. Nice."