5

I think there used to be a command called

dir -a

or something like that.

Now it's no longer there isn't it?

To see hidden file we need

dir /a:h

which will show only hidden files, which is not what I want.

So how to display all files, whether hidden or not?

Matteo
  • 7,847
user4951
  • 4,705

4 Answers4

13

dir /a lists everything, visible and hidden files altogether.

m4573r
  • 5,631
  • Does it still work? I don't see that in the documentation. – user4951 Sep 11 '12 at 09:20
  • 1
    Yeah, as I said in my comment above, it's not in the /? anymore. However I tried it before posting. – m4573r Sep 11 '12 at 09:27
  • 1
    I think this should be selected based on large number of votes. I still do not know why this answer is better than the rest. Can anyone explain? – user4951 Mar 11 '13 at 06:49
  • 1
    @JimThio, this is the correct answer, and the answer provided by Oleg is wrong. dir lists only files and directories that have every attribute in the /a: set. So use the empty set, i.e. just /a. – Eryk Sun Aug 28 '15 at 05:54
1

Depend on the environment, dir /a may work.

In other systems, dir /A: may be needed. That is, put a colon after the /A

This answer might apply to JP Software's 4DOS, as well.

Another option is to not use DIR, but to use the ATTRIB command. You're probably familiar with that command for changing file attributes. However, it can also be useful for simply showing files.

TOOGAM
  • 15,798
  • 5
  • 43
  • 63
0

Just list all attributes in /a. That'd be dir /a:drhsa on real DOS and a few more letters on Windows with NTFS, all listed under /a in help.

  • What few letters? Why not listed some of the uses? How about fully explain what dir /a:drhas actually does? – Ramhound Sep 05 '12 at 12:28
  • @Ramhound, show me "Windows" in question and I think about explicitly mentioning them. "d, r, h, s, a", if it is not plainly obvious to somebody, are "all attributes", mentioned in previous sentence. Also, what additional uses except requested, quoting: all files, you propose to me to list? – Oleg V. Volkov Sep 05 '12 at 13:23
0

The undocumented "dir," (dir followed by a comma, no space) will show all files, including both hidden and system files. Not deleted files thou, use undelete to show those.

Fabel
  • 1,238