p4 opened

List files that are open in pending changelists.


p4 [g-opts] opened [-a -c change] [-C workspace] [-u user -m max -s -g] [file ...]
p4 [g-opts] opened [-a -x] [-m max] [file ...]


Use p4 opened to list files that are currently open via p4 add, p4 edit, p4 delete, or p4 integrate. By default, all open files in the current client workspace are listed. You can use command line arguments to list only those files in a particular pending changelist, to show open files in all pending changelists, to limit the number of files displayed, or to limit the files opened for a particular user.

If file specifications are provided as arguments to p4 opened, only those files that match the file specifications are included in the report.

The information displayed for each opened file includes the file’s name, its location in the depot, the revision number that the file was last synced to, the number of the changelist under which the file was opened, the operation it is opened for (add, edit, delete, branch, move/add, move/delete, integrate, import, purge, or archive), and the type of the file. The output for each file looks like this:

depot-file#rev - actionchnum change (type) [lock-status]


You can use the -s option to provide shortened output that omits the #rev number and the (type) of the file. This form of the command typically runs faster than the default.

The -u option limits output to files opened by a particular user. Otherwise, the command applies to all users.

The -g option lists files that are opened on a commit server in a distributed installation.

The following examples show how user details are included in command output. In the following, information is about the current workspace and the current user is not identified. However, other users with files opened are identified.

$ p4 opened
//depot/file-1.txt#1 - edit default change (text) by adam@scratch
//depot/file-2.txt#1 - edit default change (text)

In this example, which asks for all workspaces, user names are always displayed:

$ p4 opened -a
//depot/file-1.txt#1 - edit default change (text) by adam@scratch
//depot/file-2.txt#1 - edit default change (text) by normal@scratch



List opened files in all client workspaces.

In distributed environments, this option lists files opened on all workspaces on your edge server.

-c change

List the files in pending changelist change. To list files in the default changelist, use p4 opened -c default.

-C workspace

List only files that are open in the specified client workspace.


List files that are opened on the commit server in a distributed installation. This allows you to track files that might be locked globally on the commit server from an edge server. Because the command query runs on the commit server, if you provide a file spec argument, it must be in depot syntax. The -g option implies the -a option.

-m max

List only the first max open files.


Short output; do not output the revision number or file type. This option is more efficient, particularly when using the -a (all-workspaces) option at large sites.

-u user

List only those files that were opened by user.

Note that this option lists files opened in any workspace for the specified user name, not just the current workspace.


In distributed environments, list all open files that have the +l filetype (exclusive open) over all servers. This option implies the -a option.


See Global Options.

Usage Notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required





p4 opened -c 35 //depot/main/...

List all files in pending changelist 35 that lie under the depot’s main subdirectory.

p4 opened -a -c default

List all opened files in the default changelists for all client workspaces.