Por que o ls -l
comando no WSL retorna arquivos e diretórios que não aparecem no Windows File Explorer ou usando o dir
comando cmd?
Saída do comando ll
( ls -l
) no WSL2 Debian 11:
user@computer:/mnt/c$ ll
ls: Config.Msi: Permission denied
ls: cannot access 'DumpStack.log.tmp': Permission denied
ls: cannot access 'hiberfil.sys': Permission denied
ls: cannot access 'pagefile.sys': Permission denied
ls: PerfLogs: Permission denied
ls: Recovery: Permission denied
ls: cannot access 'swapfile.sys': Permission denied
ls: 'System Volume Information': Permission denied
total 388
drwxrwxrwx 1 user user 4096 Dec 25 2020 '$Recycle.Bin'
dr-xr-xr-x 1 user user 4096 Jun 16 22:13 '$WinREAgent'
-r-xr-xr-x 1 user user 395268 Jul 10 2015 bootmgr
-r-xr-xr-x 1 user user 1 Oct 30 2015 BOOTNXT
-rwxrwxrwx 1 user user 80 Oct 21 2018 bootTel.dat
d--x--x--x 1 user user 4096 Jun 30 11:51 Config.Msi
lrwxrwxrwx 1 user user 12 Jul 10 2015 'Documents and Settings' -> /mnt/c/Users
-????????? ? ? ? ? ? DumpStack.log.tmp
-????????? ? ? ? ? ? hiberfil.sys
-????????? ? ? ? ? ? pagefile.sys
d--x--x--x 1 user user 4096 Dec 7 2019 PerfLogs
drwxrwxrwx 1 user user 4096 Feb 14 13:37 ProgramData
dr-xr-xr-x 1 user user 4096 Jun 30 14:07 'Program Files'
dr-xr-xr-x 1 user user 4096 Jun 30 14:56 'Program Files (x86)'
d--x--x--x 1 user user 4096 Mar 13 10:58 Recovery
-r-xr-xr-x 1 user user 27 Nov 30 2016 Settings.ini
drwxrwxrwx 1 user user 4096 Sep 2 2021 Strawberry
-????????? ? ? ? ? ? swapfile.sys
d--x--x--x 1 user user 4096 Jun 30 11:51 'System Volume Information'
drwxrwxrwx 1 user user 4096 Sep 21 2019 temp
dr-xr-xr-x 1 user user 4096 Dec 25 2020 Users
drwxrwxrwx 1 user user 4096 Apr 3 13:38 WCH.CN
dr-xr-xr-x 1 user user 4096 Jun 16 22:36 Windows
Saída do dir /a:h
comando no prompt de comando do Windows 10:
C:\>dir /a:d
C volume doesn't have a name
Volume serial number is 5DFB-D456
Directories from C:\
25/12/2020 02:49 <DIR> $Recycle.Bin
16/06/2022 22:13 <DIR> $WinREAgent
30/06/2022 11:51 <DIR> Config.Msi
10/07/2015 14:21 <JUNCTION> Documents and Settings [C:\Users]
07/12/2019 11:14 <DIR> PerfLogs
30/06/2022 14:07 <DIR> Program Files
30/06/2022 14:56 <DIR> Program Files (x86)
14/02/2022 14:37 <DIR> ProgramData
13/03/2022 11:58 <DIR> Recovery
02/09/2021 22:29 <DIR> Strawberry
30/06/2022 11:51 <DIR> System Volume Information
21/09/2019 13:37 <DIR> temp
25/12/2020 21:12 <DIR> Users
03/04/2022 13:38 <DIR> WCH.CN
16/06/2022 22:36 <DIR> Windows
0 file(s) 0 bytes
15 dir(s) 51 495 235 584 free bytes
Captura de tela do Windows File Explorer mostrando arquivos no volume C quando a opção "Mostrar arquivos ocultos" está marcada:
Como você pode ver, o WSL mostra mais arquivos como bootmgr
, bootTel.dat
ou pagefile.sys
enquanto o dir /a:h
comando mostra mais diretórios do que o File Explorer como Config.Msi
, Recovery
ou $Recycle.Bin
.
Por quê?