Kev
Kev

Reputation: 765

What does ** mean in a path?

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?

Upvotes: 50

Views: 44522

Answers (2)

yehonatan yehezkel
yehonatan yehezkel

Reputation: 1246

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

Upvotes: 12

Óscar López
Óscar López

Reputation: 236114

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

Upvotes: 86

Related Questions