Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Reference | 2025.1

# p4 where

Show how the specified files are mapped by the client view.

## Syntax

    p4 [g-opts] where [file ...]

Syntax conventions

## Description

p4 where uses the client view and root to print files locations relative to the top of the depot, relative to the top of the client workspace, and relative to the top of the local OS directory tree. The client mappings are set by the `p4 client` command. The `p4 where` command does not check to see whether the file exists. Instead, it reports where the file would be located if it did exist.

The command accepts wildcards, such as `p4 where *.html`

For each file provided as a parameter, a set of mappings is output. Each set of mappings consists of:

- the filename in depot syntax. such as `//depot/project1/my-file.html`

- the filename in client syntax, such as `//maria/depot/project1/my-file.html`

- the filename in local syntax, which is the local operating system path, such as `C:\Users\maria\project1\my-file.html`

## Options

`g-opts` | See Global options.

## Usage notes

Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required
--- | --- | ---
No | No | none because every standard user can run `p4 where`

- The mappings are derived from the client view: a simple view, mapping the depot to one directory in the client workspace, produces one line of output, such as

      //depot/project1/my-file.html  //maria/depot/project1/my-file.html  C:\Users\maria\project1\my-file.html

  More complex client views produce multiple lines of output, possibly including exclusionary mappings. For instance, given the client view:

      View: //a/... //client/a/...
            //a/b/... //client/b/...

  Running:

      p4 where //a/b/file.txt

  outputs:

      -//a/b/file.txt //client/a/b/file.txt //home/_user_/root/a/b/file.txt
      //a/b/file.txt //client/b/file.txt /home/_user_/root/b/file.txt

  This can be interpreted as saying that the first line of the client view would have caused the file to appear in `/home/user/root/a/b/file.txt`, except that it was overridden by the second mapping in the view. An exclusionary mapping was applied to perform the override, and the second mapping applies, sending the file to `/home/user/root/b/file.txt`.

- The simplest case (one line of output per file, showing each filename in depot, client, and local syntax) is by far the most common.

## Examples

`p4 where file.c` | Show depot, client workspace, and local filesystem locations of `file.c` (or where `file.c` would appear if it existed in the depot.)
`p4 where 100%25.txt` | Use ASCII expansion of "`%`" character to locations for file `100%.txt`. ASCII expansion is supported for the following four special characters: `@` (`%40`), `#` (`%23`), `*` (`%2A`), and `%` (`%25`).

## Related commands

To list the revisions of files as synced from the depot | `p4 have`

Your search for returned results