{"id":2381,"date":"2025-03-10T15:47:05","date_gmt":"2025-03-10T06:47:05","guid":{"rendered":"https:\/\/remoooo.com\/?p=2381"},"modified":"2025-03-10T15:47:07","modified_gmt":"2025-03-10T06:47:07","slug":"prevent-zone-identifier-files-from-appearing-in-wsl2","status":"publish","type":"post","link":"http:\/\/remoooo.com\/en\/prevent-zone-identifier-files-from-appearing-in-wsl2\/","title":{"rendered":"Prevent &#039;Zone.Identifier&#039; Files from Appearing in WSL2"},"content":{"rendered":"<p>When using Windows Subsystem for Linux 2, we access our Linux file system using Windows Explorer. When we copying and pasting files, might notice addition files like &#039;<code>xxx Zone.Identifier<\/code>&#8216;. <\/p>\n\n\n\n<p>The &#039;<code>Zone.Identifier<\/code>&#039; file is a Windows Attachment Manager feature that stores security information about files. However, since WSL2 uses an ext4 file system, Windows cannot store ADS natively. Instead, it creates a visible &#039;<code>Zone.Identifier<\/code>&#039; file in the same directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Delete Existing Files<\/h2>\n\n\n\n<p>If you already have &#039;<code>Zone.Identifier<\/code>&#039; files in your WSL2 directories, use one of the following methods to remove them.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#1E1E1E\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewbox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#d4d4d433\" stroke=\"#d4d4d44d\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#d4d4d433\" stroke=\"#d4d4d44d\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#d4d4d433\" stroke=\"#d4d4d44d\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"find ~\/[Your Path] -name &quot;*:Zone.Identifier&quot; -delete\" style=\"color:#D4D4D4;display:none\" aria-label=\"copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">find<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">~\/[Your<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">Path]<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-name<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">&quot;*:Zone.Identifier&quot;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">-delete<\/span><\/span><\/code><\/pre><span style=\"display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#1E1E1E;color:#c7c7c7;font-size:12px;line-height:1;position:relative\">Bash<\/span><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">2. Disable Windows from Generating &#039;<code>Zone.Identifier<\/code>&#039;<\/h2>\n\n\n\n<p>If you frequently access WSL2 files from Windows and want to permanently stop Windows from attaching &#039;<code>Zone.Identifier<\/code>&#039;, you can disable this feature via Group Policy or Registry Editor.<\/p>\n\n\n\n<p>Press <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-2-color\">Win + R<\/mark>, type <code><mark class=\"has-inline-color has-accent-2-color\">gpedit.msc<\/mark><\/code>, and hit Enter.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-2-color\">Configuration \u2192 Administrative Templates \u2192 Windows Components \u2192 Attachment Manager<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-2-color\">\u7528\u6237\u914d\u7f6e \u2192 \u7ba1\u7406\u6a21\u677f \u2192 Windows \u7ec4\u4ef6 \u2192 \u9644\u4ef6\u7ba1\u7406\u5668<\/mark>(In Chinese)<\/p>\n\n\n\n<p class=\"has-text-align-left\">Enable<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-2-color\">Do not preserve zone information in file attachments<\/mark>\u201d<\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>When using Windows Subsystem for Linux 2, we access our [&hellip;]<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2381","post","type-post","status-publish","format-standard","hentry","category-article"],"_links":{"self":[{"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/posts\/2381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/comments?post=2381"}],"version-history":[{"count":2,"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/posts\/2381\/revisions"}],"predecessor-version":[{"id":2383,"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/posts\/2381\/revisions\/2383"}],"wp:attachment":[{"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/media?parent=2381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/categories?post=2381"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/remoooo.com\/en\/wp-json\/wp\/v2\/tags?post=2381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}