Glob or shell globbing refers to the process of matching glob patterns to files in the filesystem. Best to illustrate it with an example: bash shell c

Glob tester - tool for testing glob patterns

submited by
Style Pass
2022-01-22 04:30:03

Glob or shell globbing refers to the process of matching glob patterns to files in the filesystem. Best to illustrate it with an example: bash shell command cp *.jpg ./thumbnails will copy all files that have .jpg extension to the thumbnails folder. In that context *.jpg is the glob pattern and it will match all the files in the current working directory that have .jpg extension. Think of it as a pattern matching for the filesystem.

globster.xyz is a tool to test and visualise glob pattern matching. Type your glob pattern in the input field above and all matched files will be highlighted in blue in the tree directory structure. Use it to debug when your glob does not work or to experiment and learn from the provided examples. minimatch (version 3.0.4) JavaScript library is used to evaluate glob patterns on this website.

Globbing was first introduced in unix system. It is widely used in many tools these days. Gitignore file of the git version control system is one example. Patterns are used to exclude certain files and folders from being version controlled.

Leave a Comment