# Glob
<!-- prettier-ignore -->
| | |
| --- | --- |
| **_Description:_** | A *pattern* that matches pathnames in a filesystem
| **_Annotation:_** | `glob`
| **_Literal syntax:_** | None
| **_Casts:_** | [`into glob`](/commands/docs/into_glob.md)
| **_See Also:_** | [Moving around the system - Glob patterns](/book/moving_around.md#glob-patterns-wildcards) in the Book
## Additional Language Notes
1. A `glob` is similar to a string, but it is expanded to match files using a pattern.
1. Globs are implemented using the [nu_glob](https://docs.rs/nu-glob/latest/nu_glob/index.html) crate. The [possible glob patterns](https://docs.rs/nu-glob/latest/nu_glob/struct.Pattern.html) are documented there.
1. When a command accepts a glob pattern directly:
- It will interpret a bare-word (or backtick-quoted) string as a glob. This means:
```nu
open *.txt # opens all files which ends with `.txt`
open `*.txt` # it's backtick quoted, it's a bare word, so nu opens all files which ends with `.txt`
```
- It will interpret other string types as a string literal. This means:
```nu
open "*.txt" # it's quoted, opens a file named `*.txt`
open '*.txt' # it's quoted, opens a file named `*.txt`
```
1. There is no literal syntax for a glob. As seen above, it is usually created as a string and then interpreted by the calling command as a glob.
Example
<!-- TODO: Update example to use touch once it accepts glob properly -->
<!-- touch can show the differences more tangibly -->
```nu
let s = "a*c.txt" # a string type.
open $s # opens a file literally named `a*c.txt`
let g: glob = "a*c.txt" # a glob type.
open $g # opens files matching the glob pattern, e.g: `abc.txt`, `aac.txt`
```
1. These expansions also take place with custom commands:
```nu
# open files which match a given glob pattern