WSL2: Find and Delete Zone.Identifier files
WSL2: 查找和删除 Zone.Identifier 文件
TL;DR:: Run the below code snippet to find and delete Zone.Identifier files that gets auto-generated while copying files to WSL2
摘要: 运行以下代码片段,查找并删除由于复制文件到 WSL2 时自动生成的 Zone.Identifier 文件
find . -name "*:Zone.Identifier" -type f -delete
If you ended up here chances are these pesky *:Zone.Identifier
files have broken something in your workflow. Otherwise they are harmless files that are generated while downloading a file by browsers & Windows explorer to store metadata about the file being downloaded.
如果你最终来到这里,很可能是这些讨厌的 *:Zone.Identifier
文件在你的工作流程中破坏了某些东西。否则,它们是浏览器和 Windows 资源管理器下载文件时生成的无害文件,用于存储有关下载文件的元数据。
The technical details are unnecessary for this post and most use cases, but suffice to say its is a NTFS feature and just identifies the course of the file by using one of the preidentified Security Zones that are defined by Microsoft.
对于这篇文章和大多数用例来说,技术细节是不必要的,但足以说明它是一种 NTFS 功能,只是通过使用微软定义的预先确定的安全区之一来识别文件的过程。
But because the file name contains a :
colon, which actually is not a valid character in a file name, it can break certain automated workflows and scripts. For most cases, specially on WSL / Linux system you can just delete the file without any thought.
但由于文件名中包含冒号:
,而冒号实际上不是文件名中的有效字符,它可能会破坏某些自动化工作流程和脚本。在大多数情况下,特别是在 WSL / Linux 系统上,你可以毫不犹豫地删除文件。
To do so, just run the following command in the root of the directory where you want to search and delete these files, .e.g.
为此,只需在要搜索和删除这些文件的目录的根目录下运行以下命令,例如:
cd "~/Downloads && find . -name "*:Zone.Identifier" -type f -delete"
Microsoft says they have fixed it, but users think otherwise. 微软说他们已经修复了这个问题,但用户不这么认为。
Issues #4609 and #7456 on the official WSL repository provides more details, however, this issue is definitely not fixed in Windows 11.
WSL 官方仓库中的 #4609 和 #7456 问题提供了更多详细信息,但是,这个问题在 Windows 11 中绝对没有修复。
WSL2: Find and Delete Zone.Identifier files
本文链接:https://blog.csdn.net/u012028275/article/details/143808081