Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Use wget URL from a Linux shell to download a file into the current directory. Add -O when you need an exact filename, -P when you need a destination directory, and -c when you need to continue an existing partial download. For long or shared-server jobs, combine retries, a rate limit, or background mode. This guide explains each option, the conditions under which it works, and the risks of recursive downloads.

What wget is and which version you are using

wget is a non-interactive command-line network downloader for Linux. It is designed for shell sessions, scripts, scheduled jobs and servers where there is no graphical download window. The command can retrieve one URL, continue an interrupted transfer, limit its bandwidth, run in the background, or traverse a directory tree.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The current GNU Wget manual identified for this guide is for GNU Wget 1.25.0. The executable installed on your server can be a different release or a distribution-specific build, so check the local documentation before relying on an option:

wget --version
man wget

The manual on the server is authoritative for the binary you are actually running. A successful wget --version command also confirms that the program is available in your shell’s command path.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Prepare the shell session

Before starting a transfer, decide where the bytes should go and what should happen if the connection stops. These checks prevent the most common mistakes.

  • Use pwd to see the current directory, because a plain download is saved there.
  • Use ls -ld /path/to/directory to verify that the destination is the directory you intend to use and that your account can write there.
  • For a large file, leave enough free space for the complete file and any partial copy that may already exist.
  • Keep the original URL exactly as supplied. Query strings and case can identify a different resource.
  • If you plan to resume, run the command from the location containing the earlier partial file, or explicitly select that location with -P.

These steps are operational checks rather than wget options; they make the later command’s path and filename predictable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Download one file with the base command

The minimal form is:

wget https://example.com/archive.tar.gz

wget writes the response to a file in the current directory. The command’s terminal output shows the transfer progress and final result. After it finishes, inspect the directory with ls -lh to confirm that the expected file is present.

This form is useful when the server’s URL already contains a suitable filename and you are content with the shell’s current working directory. It avoids adding options that can accidentally change the output path.

Choose the filename and destination

Use -O (uppercase letter O) to choose the output name and -P to choose the directory. The options solve different problems:

Requirement Command pattern Result
Use the URL-derived name in the current directory wget URL Saves in the shell’s current directory.
Set an exact output path and name wget -O /srv/releases/app.tar.gz URL Writes to the path and filename supplied to -O.
Keep wget’s filename but select a directory wget -P /srv/releases URL Places the download in the directory supplied to -P.

For example, to call a downloaded archive latest-hugo.zip:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wget -O latest-hugo.zip https://example.com/downloads/archive.zip

To place the URL-derived file in an existing directory:

wget -P ~/downloads https://example.com/archive.tar.gz

A full path supplied to -O already specifies both location and name; adding -P in that situation is redundant and can make a command harder to read. Choose one path strategy for each download.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Be deliberate with -O: it is an explicit output file, not merely a directory selector. If you reuse the same name, you are directing wget to that file rather than allowing a URL-derived name.

Resume an interrupted download safely

Use -c (continue) when a previous attempt left a partial file:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wget -c https://example.com/images/disk-image.iso

Continuation works only when the earlier local partial file still exists and is in the working location wget is using. If you originally saved into a directory, repeat that directory selection:

wget -c -P /srv/isos https://example.com/images/disk-image.iso

Do not assume that -c can reconstruct a file that was moved or renamed. Match the same destination and filename, or use the corresponding -O path consistently.

When continuation falls back to a full download

The server must support partial downloads for a true resume. If it does not, wget restarts the transfer and overwrites the existing file completely. On a large image, this can consume the full download time and bandwidth again. If a resume is important, watch the initial response and progress output, and verify that the server is accepting a range request before leaving a long job unattended.

A practical sequence is:

  1. Confirm that the partial file is still in the intended directory.
  2. Run the same URL with -c and the same path option used originally.
  3. Read the transfer output rather than assuming that the presence of -c guarantees continuation.
  4. After completion, compare the resulting file with the publisher’s checksum when one is provided separately.

Control bandwidth, retries and whether the command stays in the foreground

Limit the transfer rate

On a shared server, cap wget’s bandwidth with --limit-rate. The value uses byte units; k and m suffixes are available:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wget --limit-rate=200k https://example.com/video.iso

Here, 200k is a 200-kilobyte-per-second limit as interpreted by wget’s option parser. A limit protects other workloads but makes the transfer take longer, so select a value that fits the server’s network policy.

Set a finite retry policy

--tries=N sets the number of attempts wget will make. The documented default is 20. For a job that should stop after five attempts:

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
wget --tries=5 https://example.com/package.tar.xz

--tries=0 or --tries=inf requests unlimited retries. Infinite retrying is appropriate only when a supervisor or operator will stop the process; otherwise a persistent outage can leave a job running indefinitely.

Move wget into the background

The -b option moves wget into the background immediately after startup:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wget -b https://example.com/database-backup.sql

Use background mode for a transfer that should continue while you use the shell for other work or disconnect from an interactive terminal. Because you no longer watch the live progress directly, plan how you will inspect the process and its output on your server. The exact log-file behavior can vary by version and was not established here; consult man wget for the installed build.

Combine controls for a long-running job

These options can be combined in one command. For example:

wget -b --tries=5 --limit-rate=500k -P ~/downloads https://example.com/file.iso

This starts wget in the background, allows five attempts, caps the transfer at 500 KB/s, and selects ~/downloads as the destination directory. The options do not change the URL or the file’s contents; they change how the transfer is scheduled and where its output is placed.

Download a directory tree with recursion

Use -r to turn on recursive retrieval. wget follows links and retrieves a directory tree rather than stopping at the first URL:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wget -r https://example.com/releases/

Recursion needs boundaries. The default maximum depth is 5. Set an explicit depth with -l (lowercase L):

wget -r -l 2 https://example.com/releases/

Use -l 0 or -l inf to remove the depth limit. Unlimited depth can create a very large job, so choose it only when the starting site and available storage are understood.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Keep recursion below the starting directory

Add --no-parent when the starting URL is inside a larger site hierarchy:

wget -r -l 2 --no-parent https://example.com/releases/2026/

This prevents wget from climbing above the starting directory. Without the boundary, links to parent paths can expand the retrieval beyond the area you intended.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Restrict the files retrieved

Use --accept to allow matching file extensions, or --reject to exclude them. For a gallery containing several formats:

wget -r --accept=jpg,png,gif https://example.com/gallery/

The extension list is comma-separated. Filtering is especially useful when a recursive tree contains navigation pages, documents and media but you need only one class of file.

Keep recursive jobs moderate

Deep recursion is resource-intensive and may be blocked by a web server. Start with a small, explicit -l value, review the resulting tree, and increase the depth only when necessary. On a shared server, pair recursion with --limit-rate so the job does not consume the entire link.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Mirror a website for local use

--mirror is a convenience combination equivalent to -r -N -l inf --no-remove-listing. In other words, it enables recursion, unlimited depth, timestamp checking and preservation of directory listings. Because depth is unlimited, treat it as a deliberate site-archiving operation rather than a larger version of a single-file download.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A commonly useful local-copy command is:

wget --mirror -p -k https://example.com/docs/

The additional options have distinct purposes:

  • -p asks wget to fetch page requisites, such as resources needed by retrieved pages.
  • -k converts links for local viewing after retrieval.

Use --no-parent with a mirror when the archive must remain below a particular starting directory:

wget --mirror --no-parent -p -k https://example.com/docs/

Mirroring can involve many requests and substantial storage. Check the target’s access rules, choose a sensible rate limit, and stop if the server starts refusing requests. A mirror is not a license to copy an entire host indiscriminately; the starting URL, parent boundary and local capacity define the scope of the operation.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Practical command recipes

Save a release under a stable name

When an upstream URL changes its filename but your automation expects one name, use -O:

wget -O current-release.tar.gz https://example.com/releases/download

Every run targets the same local pathname, which is useful for a subsequent script that reads current-release.tar.gz.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Place a large archive in a dedicated directory

wget -P /srv/archives --limit-rate=1m https://example.com/archives/full-backup.tar

This keeps the URL-derived filename while limiting the transfer to the rate specified. The directory should already exist and be writable by the account running wget.

Run a bounded recursive collection

wget -r -l 1 --no-parent --accept=pdf,zip https://example.com/public-files/

This retrieves matching PDF and ZIP files within the selected recursion depth and does not move above public-files/. The depth and extension filter are independent: depth limits how far links are followed, while the filter limits which filenames are downloaded.

Retry a background transfer without saturating the link

wget -b --tries=5 --limit-rate=500k -P /srv/incoming https://example.com/nightly.tar

Use this pattern when the transfer can continue without an interactive terminal, but must have a finite retry budget and a predictable destination.

Troubleshoot by symptom

Symptom Likely cause Action
The file is not where expected wget used the current directory, or a different -P directory was supplied. Run pwd, inspect with ls -lh, and repeat with an explicit -P or full -O path.
A partial file starts over from zero The server does not support partial downloads, or the old file is not in wget’s working location. Confirm the path and read wget’s response; a non-supporting server causes a full overwrite even with -c.
The recursive job retrieves too much Depth is too high, unlimited, or the parent boundary is missing. Lower -l and add --no-parent; stop the job if the resulting scope is not acceptable.
The recursive job retrieves unwanted formats No file-type filter was applied. Restart with --accept for the extensions required, or --reject for extensions to exclude.
The transfer monopolizes the server link No rate cap was set. Add --limit-rate with a byte value and suffix such as 200k or 1m.
The command keeps retrying indefinitely --tries=0 or --tries=inf was used. Stop the process when appropriate, then rerun with a finite --tries=N value.
You cannot see progress after starting -b moved wget into the background. Consult the installed version’s man wget documentation for its background-output behavior and inspect the process using your server’s normal process tools.

Option selection checklist

Choose options in this order so each one answers a specific operational need:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Start with the URL alone for a single file in the current directory.
  2. Add -O when the local filename must be exact; otherwise use -P to change only the destination directory.
  3. Add -c only when a matching partial file exists and continuation is supported by the server.
  4. Add --limit-rate when the link is shared or the transfer should be throttled.
  5. Set --tries=N when the job needs a defined retry budget instead of the default of 20.
  6. Add -b when the transfer must continue outside the foreground shell.
  7. Use -r, an explicit -l, and usually --no-parent for a controlled directory tree.
  8. Use --mirror only when you intentionally need an unlimited, timestamp-aware recursive copy; add -p and -k when the result is meant for local page viewing.

Keeping each option tied to one requirement makes commands easier to audit and reduces accidental overwrites, oversized crawls and unbounded background jobs.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.