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?

5
  • This is Windows 7 you are using?
    – vgru
    Commented Oct 19, 2012 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
    Commented Oct 19, 2012 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).
    – vgru
    Commented Oct 19, 2012 at 9:23
  • @Groo: AQS does not seem to be supported at all by the dir command though. Commented Oct 19, 2012 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
    Commented Oct 19, 2012 at 9:56

1 Answer 1

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

2
  • 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
    Commented Oct 19, 2012 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
    Commented Oct 22, 2012 at 15:59

You must log in to answer this question.

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