Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
dir /? will help you here... – PhonicUK Sep 5 '12 at 9:23
I did. No such option to search all. – Jim Thio Sep 5 '12 at 9:25
You didn't read to well then. You can use /s to recursively look in directories to find all files, and /a on its own to not care about attributes. – PhonicUK Sep 5 '12 at 9:30
@PhonicUK: I respectfully disagree, there is no mention of the behaviour of /a alone in the help I get with /?. I read it a couple of times to be sure. – m4573r Sep 5 '12 at 10:05
Okay which one is correct here? Anyone tested this? – Jim Thio Sep 11 '12 at 10:20
up vote 1 down vote accepted

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.

share|improve this answer
What few letters? Why not listed some of the uses? How about fully explain what dir /a:drhas actually does? – Ramhound Sep 5 '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 5 '12 at 13:23

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

share|improve this answer
Does it still work? I don't see that in the documentation. – Jim Thio Sep 11 '12 at 9:20
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 9:27
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? – Jim Thio Mar 11 '13 at 6:49
@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. – eryksun Aug 28 '15 at 5:54

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.

share|improve this answer

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .