A bastard file is a temporary file your computer creates when a program crashes or closes unexpectedly before saving your work

When you are working in a program like Microsoft Word or Adobe Photoshop and the process suddenly stops responding, your unsaved work does not vanish completely. The program has already written some of your changes to a temporary file on your hard drive — a bastard file. This file sits on your computer with a name that does not match your original document, often with a prefix like a tilde (~) or a period (.) at the start, or an extension like .tmp or .bak. It exists because the program was interrupted before it could properly save and close.

The term "bastard file" comes from the fact that the file has no clear parent — it was not intentionally created by you, it does not have a proper name you chose, and it is not part of the normal save process. It is an orphaned file left behind by accident. Different programs name these files differently, but they all serve the same purpose: holding onto data that might otherwise be lost forever.

Key Takeaways

  • Bastard files are temporary files created automatically when a program crashes or closes without saving, and they usually sit in the same folder as your original document.
  • These files often have unusual names starting with a tilde (~), period (.), or ending in .tmp, .bak, or .swp, which makes them straightforward to spot.
  • You can usually recover your unsaved work by opening the bastard file, though the recovered content may be incomplete or partially corrupted.
  • Bastard files are safe to delete once you have recovered what you need, and deleting them does not affect your saved documents.

How bastard files get created

Most modern programs write your work to disk continuously in the background, even while you are still editing. This is called autosave or recovery data. If the program crashes before you hit Save, that temporary file remains on your hard drive. The program intended to clean it up when it closed normally, but the crash prevented that cleanup from happening.

The same thing happens when your computer loses power suddenly, when a program freezes and you force it to close, or when your operating system updates and restarts without warning. Any time a program does not shut down through its normal exit process, any temporary files it was using get left behind.

Different programs create bastard files in different locations. Microsoft Office programs often put them in the same folder as your document, or in a hidden recovery folder. Adobe programs may create .swp files. Text editors might create .bak or .tmp files. The location and naming vary, but the principle is always the same: the program was interrupted and left a trace of your work behind.

Where to find bastard files on your computer

On Windows, bastard files usually sit in the same folder as the document you were working on. Look for files that start with a tilde (~) or a period (.), or files with extensions like .tmp, .bak, .swp, or .recover. You may need to show hidden files to see them, because Windows hides files that start with a period by default.

To show hidden files in Windows 10 or 11, open File Explorer, click the View tab at the top, and check the box next to "Hidden items". Now you should see any temporary files in the folder.

On Mac, bastard files follow similar naming patterns. Open Finder, navigate to the folder where your document was, and press Command+Shift+Period (.) to toggle the display of hidden files. Look for files with unusual names or extensions that match the document you were editing.

Some programs also store recovery files in a dedicated recovery folder. Microsoft Word, for example, stores recovery files in a hidden folder inside your user directory. If you open Word after a crash, it usually prompts you to recover the document automatically — you do not have to hunt for the file yourself.

How to recover your work from a bastard file

If your program does not offer automatic recovery, you can open the bastard file manually. The simplest approach is to open the program that created it (Word, Photoshop, or whatever you were using) and then use File > Open to navigate to the temporary file. The program should recognize it and open it as a document.

If the program does not recognize the file, try renaming it to match the original document's extension. For example, if you were editing a Word document called "report.docx" and you find a file called "~report.tmp", rename it to "report.docx" and try opening it. The file may be incomplete or partially corrupted, but it often contains most of your recent work.

Once you have opened the recovered file, save it when ready with a new name or in a new location. Do not overwrite your original document until you have checked that the recovered version contains what you need. After you have saved the recovered work, you can delete the bastard file.

When bastard files cause problems

Bastard files rarely cause serious problems, but they can clutter your hard drive if they accumulate over time. If your computer crashes frequently, you may end up with dozens of temporary files scattered across your folders. They take up storage space, though usually not much — most temporary files are small.

Occasionally, a bastard file can confuse you about which version of a document is the most recent. If you see both "report.docx" and "~report.tmp" in the same folder, it is straightforward to open the wrong one by accident. This is why renaming and saving recovered files with clear names is important.

In rare cases, a corrupted bastard file can cause a program to behave strangely when it tries to recover automatically. If a program keeps crashing on startup and offering to recover a document, deleting the bastard file from the recovery folder usually fixes the problem.

Safely deleting bastard files

Once you have recovered the work you need, bastard files are safe to delete. They are temporary files with no connection to your saved documents. Deleting them will not affect any file you intentionally saved.

You can delete bastard files one at a time by right-clicking and choosing Delete, or you can select multiple files at once and delete them in bulk. If you want to clean up all temporary files on your computer at once, you can use the Disk Cleanup tool on Windows or the Storage settings on Mac, though these tools delete many types of temporary files beyond just bastard files.

If a program keeps creating the same bastard file and you do not want to recover it, you can delete it and the program should stop trying to recover it on the next startup. If the program continues to offer recovery after you have deleted the file, try restarting the program or your computer.

How to prevent bastard files from piling up

The best way to avoid bastard files is to save your work regularly and close programs normally instead of forcing them to quit. If you save every few minutes, a crash will only cost you a few minutes of work, and you will have less reason to hunt for temporary files.

Most modern programs have autosave features that you can turn on. In Microsoft Word, go to File > Options > Save and check "AutoRecover". In Google Docs or similar cloud-based programs, your work is saved automatically to the cloud, so a crash on your computer does not matter at all.

If your computer crashes frequently, that is a sign of a deeper problem — a failing hard drive, overheating, malware, or a driver issue. Addressing the root cause will prevent both crashes and the bastard files they leave behind.

Frequently Asked Questions

Can a bastard file be dangerous or contain malware?

No. A bastard file is just a temporary copy of your own work that your program created automatically. It cannot contain malware unless the original document you were editing already contained it. Bastard files are safe to open and safe to delete.

What if I cannot find the bastard file I need?

Check the recovery folder specific to the program you were using. Microsoft Office stores recovery files in a hidden folder at C:\Users\[YourUsername]\AppData\Local\Microsoft\Office\UnsavedFiles on Windows. If the file is not there, try searching your entire hard drive for files modified on the date of the crash, or check the Recycle Bin in case it was already deleted.

Is it okay to delete all temporary files on my computer at once?

Yes, it is safe to delete temporary files using Disk Cleanup or similar tools. These tools are designed to remove files that programs no longer need. The only risk is if you delete temporary files from a program that is currently running, which can cause that program to behave strangely. Close all programs before running a cleanup tool.

Why do some bastard files have weird names with tildes and periods?

Programs use these naming conventions to mark files as temporary and to hide them from your normal view. A tilde (~) or leading period (.) tells the operating system "this is a system file, do not show it by default". This keeps your folders from looking cluttered with temporary files you did not create.