GNU Wget Returning .tmp Files Instead of Actual Files? Here's the Solution!

Abstract: Resolve GNU Wget returning .tmp files by using the -c flag to resume interrupted downloads or manually deleting stale temporary artifacts.

Created: 2026-07-31 by
GNU Wget creates temporary files with a .tmp extension when the download process is interrupted, canceled, or fails before completion. To resolve this issue and retrieve your actual data, you must first locate these incomplete files in your working directory. Once identified, you can either resume the interrupted transfer using specific flags or delete the corrupted artifacts to start a fresh download. This behavior is standard for robust download managers that prioritize data integrity over speed, ensuring that partial downloads do not overwrite existing valid files.

Understanding Wget's Temporary File Behavior

When you initiate a download with wget, it does not write directly to the final filename immediately. Instead, it writes to a temporary file (often named filename.part or filename.tmp) and renames it only upon successful completion. This mechanism prevents data corruption if the network connection drops unexpectedly. If you see .tmp files remaining after a session, it indicates that the transfer did not finish cleanly. This is particularly common when downloading large datasets, such as high-resolution satellite imagery from NASA's LAADS DAAC archive, where network stability can be variable over long periods. The presence of these files is not an error in itself but a signal that the previous attempt was incomplete. It is crucial to understand that deleting these files without resuming the download will result in losing any partially downloaded data. Therefore, the solution involves either cleaning up stale files from old sessions or configuring wget to handle interruptions more gracefully.

Resuming Interrupted Downloads

The most effective way to deal with .tmp files is to use the resume feature. If you are downloading a large file and the connection drops, wget saves the progress in a temporary file. You can restart the download by adding the -c flag, which stands for "continue." This tells wget to check the size of the remote file and the local temporary file, then request the missing bytes from the server. For example, if you were downloading a satellite image named MODIS_image.hdf, and the download failed, leaving a MODIS_image.hdf.tmp or MODIS_image.hdf.part file, you would run:
wget -c https://example.com/path/to/MODIS_image.hdf
Wget will automatically detect the existing temporary file and append the new data to it. Once the download completes successfully, wget will rename the temporary file to the original name, removing the .tmp suffix. This method is essential for large scientific datasets where re-downloading from the beginning would waste significant bandwidth and time.

Cleaning Up Stale Temporary Files

If the temporary files are from previous failed attempts that cannot be resumed, or if you simply want a clean directory, you need to remove them manually. Be cautious when deleting these files, as they may contain valuable partial data. Always verify that you do not need the partial content before deletion. You can identify these files by looking for extensions like .tmp, .part, or sometimes no extension if the naming convention differs. To remove all temporary files in the current directory, you can use the rm command with a glob pattern:
rm *.tmp
rm *.part
After clearing these files, you can initiate a fresh download. Ensure that your internet connection is stable before starting large transfers to minimize the likelihood of encountering this issue again. For users managing multiple datasets, scripting this cleanup process can save considerable time.

Configuring Wget for Better Stability

To reduce the frequency of encountering stuck .tmp files, you can adjust wget's configuration options. Increasing the timeout values can help prevent premature disconnections during slow phases of the download. Additionally, enabling retry logic ensures that wget automatically attempts to reconnect if the network fails briefly. You can set these options in your .wgetrc file or pass them directly in the command line. For instance, setting a longer timeout and increasing retries looks like this:
wget --timeout=60 --tries=10 https://example.com/large_file.hdf
This approach makes the download process more resilient to transient network issues. While this does not eliminate the creation of temporary files entirely, it ensures that they are more likely to be completed rather than left behind due to simple connectivity hiccups.

Alternative Download Managers

In some cases, wget may not be the best tool for every scenario. If you frequently encounter issues with large file transfers, consider using alternative download managers that offer more advanced features like multi-threading or better error handling. Tools like curl or graphical downloaders might provide a smoother experience for certain types of data transfers. However, for automated scripts and command-line workflows, wget remains a reliable choice when configured correctly. It is also worth noting that some servers may not support resuming downloads. In such cases, the -c flag will fail, and you will need to delete the temporary file and start over. Always check the server's capabilities if you suspect that resumption is not supported.

Frequently Asked Questions

Why does wget create .tmp files instead of the final file?

Wget uses temporary files to ensure data integrity during the download process. It only renames the file to its final name once the entire transfer is verified as complete. This prevents partial or corrupted files from being saved to disk.

How can I resume a download that stopped at a .tmp file?

You can resume the download by running the wget command again with the -c flag. Wget will detect the existing temporary file and continue downloading from where it left off, provided the server supports resumption.

Is it safe to delete .tmp files created by wget?

Yes, it is safe to delete .tmp files if you do not need the partial data. However, if you intend to resume the download later, deleting the file will force you to start the download from scratch.

What should I do if wget -c fails to resume?

If the -c flag fails, the server likely does not support resuming downloads. In this case, you must delete the temporary file and start a new download from the beginning. Check the server documentation to confirm its capabilities.

Can I configure wget to automatically remove temporary files on failure?

Wget does not have a built-in option to automatically delete temporary files upon failure. You must manually remove them or write a script to clean up stale files periodically. Some users prefer to use other tools that offer more granular control over temporary file management.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More