2

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?

slhck
  • 223,558
  • 70
  • 607
  • 592
rezna
  • 201
  • 1
  • 2
  • 3
  • This is Windows 7 you are using? – vgru Oct 19 '12 at 09: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 09:18
  • Windows 7 extends the way you can use wildcards (check [this answer](http://superuser.com/a/314721/25438)). 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). – vgru Oct 19 '12 at 09:23
  • @Groo: AQS does not seem to be supported at all by the dir command though. – Marcks Thomas Oct 19 '12 at 09: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 09:56

1 Answers1

1

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...

phuclv
  • 26,555
  • 15
  • 113
  • 235
user80393
  • 146
  • 1
  • 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