Why is the "dir" command not showing me certain folders?
10,830
You need to add the "show hidden" option to dir:
dir /a
this should do the trick.
Author by
stonk-overflow
Updated on June 13, 2022Comments
-
stonk-overflow almost 2 years
I used the
dir
command in the Windows command prompt to display the list of files/folders in a directory. I noticed that it did not display a folder namedtmp
. However, I tried runningdir
in Powershell, and it did display thetmp
folder in the output. Why did the Windows command prompt hide this folder from me? -
stonk-overflow over 9 yearsBut why is the "tmp" folder hidden? It's just a normal folder in a rails project that happens to have the name "tmp." Does Windows treat folders with this name differently?
-
Caffeinated over 9 years@blahshaw - I'm guessing thats the windows default or something. seeing that in dev environ's a
tmp
folder is usually not anything we need -
stonk-overflow over 9 years"dir /a" displayed the "tmp" folder, so Windows must treat it as a hidden folder. A bit surprising since it isn't prefixed with a dot.
-
Matt over 9 years@blahshaw @coffee It's worth mentioning that
dir
in Powershell is an alias forGet-ChildItem
. By default it does not display hidden folders.Get-ChildItem -Force
would do that. -
phuclv over 6 yearsthe OP is asking how to show hidden files, not how to change their attributes
-
Phil Gilmore over 2 yearsThis answer does exactly that. It will show all the files and folders but will also indicate whether they are marked as hidden. As shown, it does NOT change the attributes.