---
name: "gmtwhich"
section: "1gmt"
platform: "linux"
package: "gmt-common"
version: "5.4.5+dfsg-2"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/gmtwhich"
---

# gmtwhich(1gmt)

Find full path to specified files

## NAME

gmtwhich - Find full path to specified files

## SYNOPSIS

**gmtwhich** *files* \[  **-A** \] \[  **-C** \] \[  **-D** \] \[  **-G** \] \[  **-V**\[*level*\] \]

**Note:** No space is allowed between the option flag and the associated arguments.

## DESCRIPTION

**gmtwhich** reports the full paths to the files given on the command line. We look for the file in (1) the current directory, (2) in $GMT\_USERDIR (if defined), (3) in $GMT\_DATADIR (if defined), or (4) in $GMT\_CACHEDIR (if defined). If found we print the full path name to the file, just the directory (see **-D**), or a confirmation (see **-C**). The $GMT\_USERDIR and $GMT\_DATADIR environment variables can be colon-separated list of directories, and we search recursively down any directory that ends with / (i.e., /export/data is a single directory whereas /export/data/ will be searched recursively.)

## REQUIRED ARGUMENTS

- ***files***

  One or more file names of any data type (grids, tables, etc.).

## OPTIONAL ARGUMENTS

- **-A**

  Only consider files that the user has permission to read \[Default consider all files found\].

- **-C**

  Instead of reporting the paths, print the confirmation Y if the file is found and N if it is not.

- **-D**

  Instead of reporting the paths, print the directories that contains the files.

- **-G**

  If a file argument is a downloadable file (either a full UR, a @file for downloading from the GMT Site Cache, or earth\_relief\_\*.grd) we will try to download the file if not found in your local data or cache dirs.

- **-V**\[*level*\] (more ...)

  Select verbosity level \[c\].

- **-^** or just **-**

  Print a short message about the syntax of the command, then exits (NOTE: on Windows just use **-**).

- **-+** or just **+**

  Print an extensive usage (help) message, including the explanation of any module-specific option (but not the GMT common options), then exits.

- **-?** or no arguments

  Print a complete usage (help) message, including the explanation of all options, then exits.

## EXAMPLES

To see the full path to the file myjunk.txt, use

```
gmt which myjunk.txt
```

To download the 10 arc-minute global relief file from the GMT data site, use

```
gmt which -G earth_relief_10m.grd
```

which will print the path (after downloading if not already present).  The file will be placed in the user's GMT\_USER\_DIR.  To obtain a GMT example or test file from the GMT cache site, try

```
gmt which -G @hotspots.txt
```

which will print the path (after downloading if not already present).  The file will be placed in the user's GMT\_CACHE\_DIR directory.

## SEE ALSO

gmt

## COPYRIGHT

2019, P. Wessel, W. H. F. Smith, R. Scharroo, J. Luis, and F. Wobbe
