Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 419
Kev Avatar asked Jun 20 '13 05:06

Kev


People also ask

What does double asterisk mean in file path?

The double asterisks are placeholders or instructions to the recursive interpreter to go through the files and folders. It is a simple, recursive wildcard while only one asterisk means all without recursion.

What does ~/ mean in path?

It means that the directory App_Data is in the root of the current application. ASP.NET Web Site Paths.

What does tilde mean in Windows path?

From Wikipedia: “The tilde symbol is used to prefix hidden temporary files that are created when a document is opened in Windows. For example, when you open a Word document called “Document1. doc,” a file called “~$cument1. doc” is created in the same directory.

What does mean in relative path?

A relative path refers to a location that is relative to a current directory. Relative paths make use of two special symbols, a dot (.) and a double-dot (..), which translate into the current directory and the parent directory. Double dots are used for moving up in the hierarchy.


2 Answers

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

like image 139
Óscar López Avatar answered Nov 04 '22 12:11

Óscar López


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

like image 39
yehonatan yehezkel Avatar answered Nov 04 '22 13:11

yehonatan yehezkel