5

I'm learning to use the terminal on Ubuntu with WSL. Right now I'm practicing wildcards, but the ? wildcard doesn't work for me.

As you can see, the * wildcard works but this one doesn't:

$ ls file*
file.html file.js file.txt
$ ls dot*
dot.txt dot1902.html dot2.txt
$ ls *.html
archivoPruebaClase.html dot1902.html file.html
$ ls dot?
ls: cannot access 'dot?': No such file or directory
$ ls index?
ls: cannot access 'index?': No such file or directory
jwodder
  • 916

1 Answers1

15

I think it is working fine:

  • A * will be replaced with any number of characters on the command line.

  • A ? will be replaced by exactly one character.

So for example ls dot?.txt will show dot1.txt, dot2.txt, etc., but it wouldn’t for example show dot10.txt.

Try ls -a to list all files/folders in that folder and you can then work out what should be listed with your wildcard use.

wjandrea
  • 14,504
Will
  • 2,483
  • 5
  • 20
  • 34