What does ** mean in a path?

Kev picture Kev · Jun 20, 2013 · Viewed 7k times · Source

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?

Answer

Óscar López picture Óscar López · Jun 20, 2013

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