Globbing Patterns
When a command has an argument with a type of Globber for a file path, that means you can use file globbing patterns to affect more than one file at a time. Globbing patterns are common in Bash as well as places like your .gitignore file. They use common wildcard patterns to provide a partial path that can match zero or hundreds of files all at the same time.

"?" matches a single character

If a globbing pattern contains a question mark, that will match any single character. So a pattern of ca?.txt would match car.txt, and cat.txt, but not cart.txt. You can use a wildcard more than once. p?p?.cf? would match files named papa.cfm and pipe.cfc.

"*" matches any number of characters within name

If a globbing pattern contains a single asterisks, that will match zero or more characters inside a filename or folder name. So d*o matches doodoo, dao, and just do. The wildcard only counts inside a file or folder name, so models/*.cfc will only match cfc files in the root of the models folder.

"**" matches any number of characters across all directories

To extend the previous example, if we did models/**.cfc that would match any cfc file in any subdirectory, no matter how deep.

Globbing examples

Here's some examples of what file globbing might look like:
1
CommandBox> rm temp*.txt
2
CommandBox> cp *.cfm backup/
3
CommandBox> touch build/*.properties
Copied!
Here's some more examples of how the wildcards work
1
// Match any file or folder starting with "foo"
2
foo*
3
4
// Match any file or folder starting with "foo" and ending with .txt
5
foo*.txt
6
7
// Match any file or folder ending with "foo"
8
*foo
9
10
// Match a/b/z but not a/b/c/z
11
a/*/z
12
13
// Match a/z and a/b/z and a/b/c/z
14
a/**/z
15
16
// Matches hat but not ham or h/t
17
/h?t
Copied!
Since the Globber library can handle more than one globbing pattern, any command that uses a Globber type can accept a comma-delimited list of patterns. The following will list any .cfm AND .md files in the directory.
1
dir *.cfm,*.md
Copied!
Last modified 5mo ago