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.

source

Share:
10,830
stonk-overflow
Author by

stonk-overflow

Updated on June 13, 2022

Comments

  • stonk-overflow
    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 named tmp. However, I tried running dir in Powershell, and it did display the tmp folder in the output. Why did the Windows command prompt hide this folder from me?

  • stonk-overflow
    stonk-overflow over 9 years
    But 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
    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
    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
    Matt over 9 years
    @blahshaw @coffee It's worth mentioning that dir in Powershell is an alias for Get-ChildItem. By default it does not display hidden folders. Get-ChildItem -Force would do that.
  • phuclv
    phuclv over 6 years
    the OP is asking how to show hidden files, not how to change their attributes
  • Phil Gilmore
    Phil Gilmore over 2 years
    This 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.