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

P4 CLI Reference | 2025.1

# p4 labels

Display the list of defined labels.

## Syntax

    p4 [g-opts] labels [-U|-R] [-t] [-u user [--user-case-insensitive] | --me] [[-e|-E] filter] [-m max] [FileSpec[revSpec]]
    p4 [g-opts] labels [-U|-R] [-t] [-u user | --me] [[-e|-E] filter] [-m max] [-a | -s serverID]
    p4 [g-opts] labels -U

Syntax conventions

## Description

p4 labels lists all the labels known to the P4 Perforce service in the form:

    Label labelname date description

Use the `-t` option to display the time of the last update to the label.

    Label labelname date time description

To see a list of loaded static labels that tag specific files, specify a file pattern, with an optional revision range. (Because automatic labels refer to all files in the label view at a specified revision range, automatic labels are not shown when you use `p4 labels` with a file pattern.)

Use the `-m max` option to limit the output to the first `max` labels.

Use the `-e` or `-E filter` options to limit the output to labels whose name matches the `filter` pattern. The `-e` option is case-sensitive, and `-E` is case-insensitive.

Use the `-u user` option to limit the output to labels owned by the named user.

## Options

`-a` | List all labels, not just labels bound to this server. This option cannot be used with a file specification.
`-e filter` | List only labels matching `filter` (case-sensitive).
`-E filter` | List only labels matching `filter` (case-insensitive).
`-m max` | List only the first `max` labels.
`-s serverID` | List only those labels bound to the specified `serverID`. This option cannot be used with a file specification.
`-t` | Display the time as well as the date of the last update to the label.
`-u user` | List only labels owned by `user`. This can include `*` wildcards to form a search pattern. If wildcards are used enclose the search pattern in double quotes (`"`). You can also add the `--user-case-insensitive` suboption to indicate that the user value is a case-insensitive search pattern, even for a case-sensitive server.
`--me` | Equivalent to `-u $P4USER`.
`-U` | List labels in the unload depot. For details, see `p4 unload`.
`-R` | List only labels with the `autoreload` option set. For a description of the `autoreload` in the `Options` field, see Form Fields in p4 label.
`g-opts` | See Global options.

## Usage notes

Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required
--- | --- | ---
N/A | N/A | `list`

- To see a list of files tagged by a particular label, use `p4 files` `@`labelname``.
- In a multi-server environment, users connected to an edge server receive only those labels that are bound to their edge server, unless they explicitly request otherwise by specifying the `-a` or `-s serverID` options.

- The command returns no output if there is no object to report on.

## Examples

To list all labels in the system | `p4 labels`
To list all labels that contain any revision of file.c | `p4 labels file.c`
To list only labels containing revisions `#3` through `#5` of file.c | `p4 labels file.c#3,5`
To list only labels associated with user names that start with the letters `jk`. If you use the `*` wildcard, enclose the search pattern in double quotes ("). | `p4 labels -u "jk*"`

## Related commands

To create a label and tag files with the label | p4 tag
To create or edit a label specification | p4 label
To add, delete, or change the files included in a label | p4 labelsync
To view a list of files included in a label | p4 files @Labelname

Your search for returned results