44

ive been setting up Grunt for my web app to auto build it and im seeing paths like

/path/to/file/**/*.js

i understand what one wildcard means, but what does 2 in a row mean?

yehonatan yehezkel
  • 1,116
  • 18
  • 28
Kev
  • 705
  • 1
  • 5
  • 10

2 Answers2

79

/path/to/file/**/*.js matches any number of directories between /path/to/file/ and /*.js. As opposed to /path/to/file/*/*.js, which matches a single directory between /path/to/file/ and /*.js.

Óscar López
  • 232,561
  • 37
  • 312
  • 386
10

this matchers called "glob pattern" they are widely used in shell script and in CLI tools like grunt or npm .they '**' means -- "Matches zero or more directories, but will never match the directories . and .. " you can read more in the docs glob pattern

yehonatan yehezkel
  • 1,116
  • 18
  • 28