为什么 Ubuntu Windows Subsystem of Linux 的空间使用率低于微软商店下载包?

为什么 Ubuntu Windows Subsystem of Linux 的空间使用率低于微软商店下载包?

在我的个人电脑上,磁盘使用量C:\Users\DD\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs仅为93MB,但下载包比240MB我安装时要多。

还有其他目录也用于吗wsl

答案1

隐藏文件夹下有一些文件系统对象C:\Program Files\WindowsApps\(它们的名称取决于 WSL 版本):

C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2018.817.0_x64__79rhkp1fndgsc

此文件夹大约占用214.4 密布(从以下 PowerShell 代码片段返回):

((Get-ChildItem "C:\Program Files\WindowsApps\Canonical*" -Recurse -Force) | 
    Measure-Object -Property Length -Sum).Sum/1MB

更详细-复制粘贴下面的代码片段打开升高PowerShell 提示符:

# run elevated
$WinApps = 'C:\Program Files\WindowsApps'                       # parent
(Get-ChildItem "$WinApps\*Ubuntu*" -Force -Dir).Name            # Ubuntu On Windows
(Get-ChildItem "$WinApps\*Ubuntu*" -Force -Dir -Recurse).Name   # subfolders
(Get-ChildItem "$WinApps\Can*" -Force -Recurse ) | 
    Measure-Object -Property Length -Sum -Maximum               # measure files
(Get-ChildItem "$WinApps\Can*\install*" -Force -Recurse )       # the greatest file

结果

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Loading personal and system profiles took 649ms.
PS C:\WINDOWS\system32> # run elevated
PS C:\WINDOWS\system32> $WinApps = 'C:\Program Files\WindowsApps'                       # parent
PS C:\WINDOWS\system32> (Get-ChildItem "$WinApps\*Ubuntu*" -Force -Dir).Name            # Ubuntu On Windows
CanonicalGroupLimited.UbuntuonWindows_1804.2018.817.0_x64__79rhkp1fndgsc
PS C:\WINDOWS\system32> (Get-ChildItem "$WinApps\*Ubuntu*" -Force -Dir -Recurse).Name   # subfolders
AppxMetadata
Assets
microsoft.system.package.metadata
PS C:\WINDOWS\system32> (Get-ChildItem "$WinApps\Can*" -Force -Recurse ) |
>>     Measure-Object -Property Length -Sum -Maximum               # measure files

Count    : 52
Average  :
Sum      : 224813301
Maximum  : 223983209
Minimum  :
Property : Length

PS C:\WINDOWS\system32> (Get-ChildItem "$WinApps\Can*\install*" -Force -Recurse )       # the greatest file


    Directory: C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2018.81
    7.0_x64__79rhkp1fndgsc


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       23.08.2018     20:50      223983209 install.tar.gz

相关内容