---
agentTools:
  projectIndex: https://docs.cancergenomicscloud.org/llms.txt
---

# Glob

A **glob** is an expression used to specify a set of filenames that match a pattern. Globs use wildcard characters to define a pattern. For example: **\*.bam** is a glob pattern that uses the **\*** wildcard to match all files with the **.bam** extension.

\##Syntax

The table below presents the most common wildcards and the way they are used:

[block:parameters]
{
  "data": {
    "h-0": "Wildcard",
    "h-1": "Description",
    "h-2": "How it works",
    "0-0": "**\\***",
    "1-0": "**?**",
    "2-0": "**[...]**",
    "0-1": "Matches any number of any characters, including none.",
    "1-1": "Matches any single character.",
    "2-1": "Matches one character from the explicit list or range of characters provided in the bracket.",
    "0-2": "* **\\*ten** matches **listen**, **ten**\n* **\\*let\\*** matches **let**, **droplet**, **lethal**.",
    "1-2": "* **?ing** matches **king**, **ring**, **sing**, etc. Does not match **ing**.",
    "2-2": "* **[bcy]ell **matches **bell**, **cell** or **yell**. Does not match **ell**.\n* **sample[1-4]** matches **sample1**, **sample2**, **sample3** or **sample4**."
  },
  "cols": 3,
  "rows": 3
}
[/block]

\##Using glob patterns on the CGC

Cancer Genomics Cloud supports all of the above wildcards. Glob patterns are most commonly used in the tool editor to specify which file(s) are reported as outputs on a tool's output port:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/66c779b-glob-2.jpg",
        "glob-2.jpg",
        949,
        847,
        "#e0e9ed"
      ]
    }
  ]
}
[/block]

In this case, all files that match the **\*SJ.out.tab** pattern (files whose name ends with **SJ.out.tab**) will be treated as output files on this port of the tool.

A glob pattern can also be used to specify which files will be caught as log files when running a tool:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/240c2b6-glob-1.jpg",
        "glob-1.jpg",
        650,
        463,
        "#e9e8e7"
      ]
    }
  ]
}
[/block]

The glob pattern used here is **\*.txt**, which will result in capturing all TXT files produced by the tool as log files.