After using WSL for more than 2 years already, I cannot be thankful enough of using Windows for some things and Linux for others. It's quite useful to move around those 2 environments without using dual boot. When copying files from one environment to other, you may have noticed strange hidden files appearing alongside them, usually with names ending in :Zone.Identifier. They are part of Windows’ security system, known as “Alternate Data Streams” (ADS), and their purpose is basically to mark files that originated from the web or another potentially unsafe location, so that Windows can warn you before opening them.
While this security feature can be helpful, it can also create clutter or cause unexpected behavior when moving or sharing files. Many users prefer to remove these hidden zone identifier files once they are confident about the safety of their downloads. In this article, we'll explore what Zone.Identifier files are, why they appear, and a simple method to safely delete them from your system.
What are Zone Identifier files?
In WSL (Windows Subsystem for Linux), you will find some odd-looking files with names like Zone:Identifier when exploring the WSL filesystem. They appear, for example, when moving a file from Windows to Linux using Windows Explorer. Or when you download a file from the internet (browser, email, etc.) on Windows, the operating system marks it with a "Zone Identifier".
This is stored as a hidden alternate data stream attached to the file, with the name Zone.Identifier and it contains metadata about the file’s origin (e.g., was it downloaded from the internet, an intranet, or a local machine). This is an example of the content of such a file:
Where:
- ZoneId=3 → Internet
- ZoneId=2 → Intranet
- ZoneId=1 → Local machine
[ZoneTransfer]
ZoneId=3
ReferrerUrl=https://compressor.io/
HostUrl=https://compressor.io/dl/u/eeb9d4137e8f85e0.jpeg
How to remove them in WSL
In my case, and probably to many of the users of WSL, I don't need those files appearing in my files, for example, when I download a Git repository and try to move files from windows to Linux, which is the most usual case for developers. It's either necessary to add that kind of file to the .gitignore file or to remove them, but in my case, as I work with hundreds of git repositories constantly, I'd just delete them whenever there are too many of them.
There are other specific cases when having such files can break workflows as the files contains a : colon, which actually is not a valid character in a file name, and it can therefore break certain automated scripts that don't expect such characters in a filename. To delete these files with a single command, open your terminal while being in WSL and type the following command inside the directory that you want to clean up:
find . -name "*:Zone.Identifier" -type f -delete
This command will find all those files in the current folder and delete them without confirmation. Remember that:
- They’re not essential for WSL or Linux.
- Windows uses them for security prompts like "This file was downloaded from the internet, are you sure you want to open it?".
- If you don’t need that metadata, you can safely delete it in WSL.
Happy coding ❤️!