Created
May 2, 2013 16:45
-
-
Save pablasso/5503538 to your computer and use it in GitHub Desktop.
wget thingies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -E --adjust-extension’ | |
| If a file of type ‘application/xhtml+xml’ or ‘text/html’ is downloaded and the URL does not end with the regexp ‘\.[Hh][Tt][Mm][Ll]?’, this option will cause the suffix ‘.html’ to be appended to the local filename. This is useful, for instance, when you're mirroring a remote site that uses ‘.asp’ pages, but you want the mirrored pages to be viewable on your stock Apache server. Another good use for this is when you're downloading CGI-generated materials. A URL like ‘http://site.com/article.cgi?25’ will be saved as article.cgi?25.html. | |
| Note that filenames changed in this way will be re-downloaded every time you re-mirror a site, because Wget can't tell that the local X.html file corresponds to remote URL ‘X’ (since it doesn't yet know that the URL produces output of type ‘text/html’ or ‘application/xhtml+xml’. | |
| As of version 1.12, Wget will also ensure that any downloaded files of type ‘text/css’ end in the suffix ‘.css’, and the option was renamed from ‘--html-extension’, to better reflect its new behavior. The old option name is still acceptable, but should now be considered deprecated. | |
| At some point in the future, this option may well be expanded to include suffixes for other types of content, including content types that are not parsed by Wget. | |
| ‘-nH’ | |
| ‘--no-host-directories’ | |
| Disable generation of host-prefixed directories. By default, invoking Wget with ‘-r http://fly.srk.fer.hr/’ will create a structure of directories beginning with fly.srk.fer.hr/. This option disables such behavior. | |
| ‘-nd’ | |
| ‘--no-directories’ | |
| Do not create a hierarchy of directories when retrieving recursively. With this option turned on, all files will get saved to the current directory, without clobbering (if a name shows up more than once, the filenames will get extensions ‘.n’). | |
| ‘-H’ | |
| ‘--span-hosts’ | |
| Enable spanning across hosts when doing recursive retrieving (see Spanning Hosts). | |
| ‘-k’ | |
| ‘--convert-links’ | |
| After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-htmlcontent, etc. | |
| Each link will be changed in one of the two ways: | |
| • The links to files that have been downloaded by Wget will be changed to refer to the file they point to as a relative link.Example: if the downloaded file /foo/doc.html links to /bar/img.gif, also downloaded, then the link in doc.html will be modified to point to ‘../bar/img.gif’. This kind of transformation works reliably for arbitrary combinations of directories. | |
| • The links to files that have not been downloaded by Wget will be changed to include host name and absolute path of the location they point to.Example: if the downloaded file /foo/doc.html links to /bar/img.gif (or to ../bar/img.gif), then the link in doc.html will be modified to point to http://hostname/bar/img.gif. | |
| Because of this, local browsing works reliably: if a linked file was downloaded, the link will refer to its local name; if it was not downloaded, the link will refer to its full Internet address rather than presenting a broken link. The fact that the former links are converted to relative links ensures that you can move the downloaded hierarchy to another directory. | |
| Note that only at the end of the download can Wget know which links have been downloaded. Because of that, the work done by ‘-k’ will be performed at the end of all the downloads. | |
| ‘-p’ | |
| ‘--page-requisites’ | |
| This option causes Wget to download all the files that are necessary to properly display a given html page. This includes such things as inlined images, sounds, and referenced stylesheets. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment