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

In my directory I have the files files

  • x.dll
  • x.lib
  • x.pdb
  • x.exp
  • x.plugin

When I issue the command dir \*.*~ it should say 'File not found' as it does at my friend's laptop. But on my machine it lists the file x.plugin.

Actually after a while of trying I found out that it lists all files with extension longer than 3 characters.

Anybody heard about this behavior before?

share|improve this question
This is Windows 7 you are using? – Groo Oct 19 '12 at 9:12
yes it is. and it must be quite a new behavior, as it used to work correctly (means only files like x.bak~ being returned for the supplied wildcard) – rezna Oct 19 '12 at 9:18
Windows 7 extends the way you can use wildcards (check this answer). But adding a tilde (~) at the end doesn't seem supported, so the result may be undefined, as you're getting. Adding it at the beginning of the query should tell Win 7 to use DOS style syntax for wildcards (but the tilde itself will be ignored). – Groo Oct 19 '12 at 9:23
@Groo: AQS does not seem to be supported at all by the dir command though. – Marcks Thomas Oct 19 '12 at 9:53
XP I just get file not found. Even when extension is over 3 char. And even when there are files starting with ~ , and even when there's a file with both features ~df.adfdfd it says File Not Found. What even caused you to do dir *.*~ ? – barlop Oct 19 '12 at 9:56

Seeing the command 'dir * . * ~', I would assume it lists all files in the directory.

The '*' placeholder means 'any number of any character'.

If you want to find all files ending in 'xx~', I would use the command 'dir *.??~'. The '?' means 'any one character'.

At least, this used to be so in the 'old' DOS days...

share|improve this answer
this used to work - and still it works on my friend's machines *.*~ returns all files who's extension ends with '~' - this means, lists all backup files which for example jEdit creates – rezna Oct 19 '12 at 10:48
@rezna does your friend have a different cmd.exe ? like a different size? (as the dir command is within that file), so i'm wondering if he has a different dir command. – barlop Oct 22 '12 at 15:59

You must log in to answer this question.

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