{"id":1616,"date":"2024-02-15T00:00:00","date_gmt":"2024-02-15T05:00:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=1616"},"modified":"2024-02-21T08:03:09","modified_gmt":"2024-02-21T13:03:09","slug":"wget-cheat-sheet","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/wget-cheat-sheet\/","title":{"rendered":"wget Cheat Sheet"},"content":{"rendered":"\n<p>Wget is a powerful command-line utility for downloading files from the web. Whether you need to grab a single file, mirror an entire website, or perform more advanced tasks, <code>wget<\/code> has got you covered.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Basic Usage:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget [URL]<\/code><\/td><td>Download a file.<\/td><\/tr><tr><td><code>wget -O [new_filename] [URL]<\/code><\/td><td>Rename the downloaded file.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Resuming Downloads:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget -c [URL]<\/code><\/td><td>Resume an interrupted download.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Limiting Download Speed:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget --limit-rate=100k [URL]<\/code><\/td><td>Limit download speed (e.g., 100KB\/s).<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Recursive Download:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget --recursive --no-clobber --page-requisites --html-extension --convert-links --domains website.com --no-parent [URL]<\/code><\/td><td>Download entire website.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>HTTP Authentication:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget --user=[username] --password=[password] [URL]<\/code><\/td><td>HTTP Basic authentication.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>FTP Download:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget ftp:\/\/username:password@ftp.example.com\/file.txt<\/code><\/td><td>Download from FTP server.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Mirror a Website:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget --mirror --convert-links --adjust-extension --page-requisites --no-parent [URL]<\/code><\/td><td>Mirror a website for offline viewing.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Quiet Mode:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget -q [URL]<\/code><\/td><td>Run in quiet mode (no output except for errors).<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Show Progress:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget --progress=bar [URL]<\/code><\/td><td>Show a progress bar during download.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Logging:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget -o [logfile.txt] [URL]<\/code><\/td><td>Log download output to a file.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Help and Version:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>wget --version<\/code><\/td><td>Display <code>wget<\/code> version.<\/td><\/tr><tr><td><code>wget --help<\/code><\/td><td>Display <code>wget<\/code> help.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p>This <code>wget<\/code> cheat sheet provides a handy reference for a variety of tasks, from basic file downloads to more advanced operations like mirroring websites. Experiment with these commands to streamline your file retrieval processes. Adjust the options based on your specific needs to make the most of <code>wget<\/code>&#8216;s capabilities.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wget is a powerful command-line utility for downloading files from the web. Whether you need to grab a single file, mirror an entire website, or perform more advanced tasks, wget has got you covered. Basic Usage: Command Description wget [URL] Download a file. wget -O [new_filename] [URL] Rename the downloaded file. Resuming Downloads: Command Description [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1785,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[35],"class_list":["post-1616","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/1616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=1616"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/1616\/revisions"}],"predecessor-version":[{"id":1617,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/1616\/revisions\/1617"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media\/1785"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=1616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=1616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=1616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}