2

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
  • 442
  • 2
  • 10
  • 22

2 Answers2

5

You need to add the "show hidden" option to dir:

dir /a

this should do the trick.

source

Caffeinated
  • 11,982
  • 40
  • 122
  • 216
  • 1
    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? – stonk-overflow Sep 23 '14 at 23:55
  • 1
    @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 – Caffeinated Sep 23 '14 at 23:57
  • 1
    "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. – stonk-overflow Sep 24 '14 at 00:00
  • 2
    @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`](http://technet.microsoft.com/en-us/library/ee692796.aspx) would do that. – Matt Sep 24 '14 at 03:07
0

Try attrib /?. EG attrib c:\folder\tmp /d.

A leading dot means nothing in Windows.

Noodles
  • 1,981
  • 1
  • 11
  • 4
  • the OP is asking how to show hidden files, not how to change their attributes – phuclv Dec 22 '17 at 07:00
  • 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. – Phil Gilmore Dec 08 '21 at 18:04