Commands by functional area
Commands can grouped by functional area, such as Security or Streams. Expand a specific section or expand or collapse all functional areas.
If you are using P4 Cloud, only a subset of configurables are available. To learn more, see P4 Cloud configurables.
|
Command |
Description |
|---|---|
| p4 admin | Perform administrative operations on the server. |
| p4 archive | Archive obsolete revisions to an archive depot. |
| p4 bgtask | Run background commands or triggers on the server. |
| p4 cachepurge | Reclaim disk space on a replicated server. |
| p4 configure | Set, view, and manage server configuration variables, including comments. |
| p4 counter | Access, set, increment, or delete a persistent variable. |
| p4 counters | Display the list of long-term variables used by P4 Server and associated scripts. |
| p4 dbschema | Report information about metadata in the database on the P4 Server. |
| p4 dbstat | Display size or simple statistics for one or more database tables. |
| p4 depot | Create, edit, or delete a depot specification. |
| Display a list of depots known to the .P4 Server. | |
| Generate diagnostic data about the P4 Server. | |
| p4 diskspace | Display disk space information on the server. |
| p4 extension | Create and configure P4 Extensions. |
| p4 failback | After a failover with target server The immediately upstream server for replica servers, edge servers, standby servers, proxies and brokers. See also 'upstream server' and 'central server'. participation, fail back to restore the previous role of that target server. |
| p4 failover | Fail over to a standby server. |
| p4 heartbeat | Monitor the responsiveness of a target server, such as a standby server monitoring its target server The immediately upstream server for replica servers, edge servers, standby servers, proxies and brokers. See also 'upstream server' and 'central server'., to help the administrator determine if a failover might be needed. |
| p4 journals | Display history of checkpoint and journal activity for the server. |
| p4 key | Display, set, or delete a key/value pair. |
| p4 keys | Display list of known key/value pairs. |
| p4 license | Update or display the license file. |
| p4 lockstat | Report lock status of database tables. |
| Add a line to any user log P4 Server supports the standard log, which is human-readable, as well as structured logs in a comma-separated value (CSV) format. The P4LOG environment variable specifies the log file for events, including errors. The human-readable P4AUDIT environment variable specifies the log file that records file transfers to users. Structured log files are typically processed by external tools. To learn more, see 'Logging" in P4 Server Administration Documentation. files. | |
| p4 logexport | Export a structured server log file to an external service using the OpenTelemetry Protocol (OTLP). |
| p4 logger | Report changed jobs and changelists. |
| Parse a structured log file and return log data. | |
| p4 logrotate | Rotate one or more structured log P4 Server supports the standard log, which is human-readable, as well as structured logs in a comma-separated value (CSV) format. The P4LOG environment variable specifies the log file for events, including errors. The human-readable P4AUDIT environment variable specifies the log file that records file transfers to users. Structured log files are typically processed by external tools. To learn more, see 'Logging" in P4 Server Administration Documentation. files. |
| p4 logschema | Describe the schema of structured log record types. |
| p4 logstat | Report size of journal, error log, and/or audit log files, or report size of the specified structured file. |
| p4 logtail | Display the last block(s) of the error log. |
| p4 monitor | Display P4 Server process information and control long-running tasks. |
| p4 obliterate | Permanently removes files and their history (metadata) from the depot. |
| p4 ping | Test network performance. |
| p4 property | Add, delete, or list property values. |
| p4 proxy | Display Proxy connection information. |
| p4 pull | Retrieve metadata or versioned files from a
P4 Servertarget server The immediately upstream server for replica servers, edge servers, standby servers, proxies and brokers. See also 'upstream server' and 'central server'. to its standby or replica, or display status information about pending
transfers. There is a special syntax for a commit server to pull from a replica. In most situations, server replication with p4 pull
is preferable to p4
replicate. |
| p4 reload | Reloads the specified workspace, label, or task stream from the unload depot. |
| p4 renameclient | Rename a client workspace. |
| p4 replicate | Poll for journal changes on one P4 Server for forwarding to another P4 Server. |
| p4 restore | Restore old archived revisions from an archive depot. |
| p4 reviews | List the users who are subscribed to review files. |
| p4 server | Create, modify, or delete a P4 Server specification. |
| Get or set the unique ID associated with a P4 Server. | |
| p4 servers | Display list of all server specifications or evaluate replication status. |
| p4 storage | Display, verify, or update physical archive storage. |
| p4 topology | Reports the P4 servers that are connected directly and indirectly to the innermost server, including an indicator of the server this command is running on. |
| p4 triggers | Create or display a list of scripts to be run conditionally when certain operations are performed, such as changelist submitted, form updated, journal rotated, and more. |
| p4 typemap | View or modify the file name-to-type mapping table. |
| p4 unload | Unloads a workspace, label, or task stream to the unload depot or to a flat file. |
| p4 upgrades | Show server upgrade status. |
| p4 verify | Verify that the P4 Server archives (depot files) are intact (complete and without corruption). |
| p4 webserver | Start or stop the P4 Web Server. |
|
Command |
Description |
|---|---|
| p4 change | Create or edit a changelist specification. |
| p4 changelist | This command is an alias for p4 change. |
| p4 changelists | This command is an alias for p4 changes. |
| p4 changes | List submitted and pending changelists. |
| p4 describe | Provides information about changelists, as well as files in the changelists, and the path of the open stream, if a stream is open. |
| Print detailed information about the revisions of files. | |
| p4 opened | Display the list of files opened in pending changelists. |
| p4 reopen | Move opened files between changelists or change the files' type, or move the client's stream spec to a different changelist. |
| p4 review | List and track changelists (for the review daemon). |
| p4 shelve | Store files (or a stream spec) from a pending changelist in the depot without submitting them. |
| p4 submit | Submit a pending changelist and the files it contains to the depot, and/or submit an open stream spec. |
| p4 undo | Undo a range of revisions. |
| p4 unshelve | Retrieve shelved files and the stream spec from a pending change into a workspace. |
To learn more, see P4 Server Administration Documentation.
|
Command |
Description |
|---|---|
| Copy files from a remote server into your local server. | |
| p4 init | Initializes a new P4 Server. |
| p4 push | Copy submitted files in your local server to a remote server. |
| p4 remote | Create, modify or delete a remote specification. |
| p4 remotes | Display a list of remote specifications. |
| p4 unsubmit | Unsubmit a changelist, making it a shelved set of changes. |
|
Command |
Description |
|---|---|
| p4 set | View or set P4 variables used by P4 Server and client applications. |
| Environment and registry variables | Variables that allow you to specify things such as the name of the client workspace, which files to exclude from version control, and more. |
| P4AUDIT | Location of the audit log P4 Server supports the standard log, which is human-readable, as well as structured logs in a comma-separated value (CSV) format. The P4LOG environment variable specifies the log file for events, including errors. The human-readable P4AUDIT environment variable specifies the log file that records file transfers to users. Structured log files are typically processed by external tools. To learn more, see 'Logging" in P4 Server Administration Documentation. file. |
| P4AUTH | A hostname and port number of an optional P4 Server that multiple P4 Servers use for authorization. |
| P4BROKEROPTIONS | Set P4 Broker options for a Windows service. |
| P4CHANGE | The hostname and port number of the optional centralized changelist server from which this P4 Server is being configured to get the most recent unused changelist number. |
| P4CHARSET | Character set used for translation of unicode files. |
| P4COMMANDCHARSET | Used to support UTF-16 and UTF-32 character sets from the Command-line Client. |
| P4CLIENT | Name of the current workspace. |
| Contains a file name without a path. The specified file is used to store other P4 Server environment variables. | |
| P4DEBUG | Set debug levels or configurables that affect P4 Server or proxies running as Windows services. |
| P4DIFF | The name and location of the diff program used by p4 resolve and p4 diff. |
| Used to support UTF-16 and UTF-32 character sets from the Command-line Client. | |
| P4EDITOR | The editor invoked by P4 Server commands that use forms |
| P4HOST | Name of host computer to impersonate. |
| P4IGNORE | Specify a filename or list of filenames that contain rules for ignoring files when adding client workspace files to the depot (p4 add) and when reconciling client workspaces (p4 reconcile). |
| A file that holds the P4 Server database’s journal data. | |
| This environment variable is reserved for system integrators. See also Internationalization Notes. | |
| P4LOG | Name and path of the log P4 Server supports the standard log, which is human-readable, as well as structured logs in a comma-separated value (CSV) format. The P4LOG environment variable specifies the log file for events, including errors. The human-readable P4AUDIT environment variable specifies the log file that records file transfers to users. Structured log files are typically processed by external tools. To learn more, see 'Logging" in P4 Server Administration Documentation. file to which P4 Server events are written. |
| P4MERGE | A third-party merge program to be used by p4 resolve's merge
option. |
| P4MERGEUNICODE | Used to support UTF-16 and UTF-32 character sets from the Command-line Client. |
| P4PAGER | The program used to page output from p4 resolve's diff
option. |
| P4PASSWD | Supplies the current P4 Server user’s password for any P4 Server command. |
| P4PCACHE | For the P4 Proxy, the directory in which the proxy stores its files and subdirectories. |
| P4PFSIZE | For the
P4 Proxy, the size
(in bytes) of the smallest file to be cached. All files larger than
P4PFSIZE bytes in length are cached. |
| P4POPTIONS | Set P4 Proxy options for a Windows service |
| P4PORT | For the Perforce service (server, broker, or proxy), the port number to listen on and the transport protocol for binding. For client applications, the protocol, host, and port number of the Perforce service with which to communicate. |
| P4ROOT | The directory in which the P4 Server stores its database files. |
| P4TARGET | For the P4 Proxy and replica servers, the name and port number of the target P4 Server (that is, the P4 Server for which P4P acts as a proxy). For a replica or edge server, the upstream server Any server in the inward direction, that is, toward the central server. For example, in an edge-to-edge configuration with a commit, edge1, and edge2, both edge1 and the commit server are upstream servers for edge2. See also 'central server'. from which it retrieves its data, and towards which changelists, if applicable, are forwarded. |
| P4TICKETS | The location of the ticket file used by p4 login. |
| P4USER | Current P4 Server username. |
| PWD | The directory used to resolve relative filename arguments to P4 Server commands. |
| TMP, TEMP | The directory to which P4 Server applications and services write temporary files. |
|
Command |
Description |
|---|---|
| p4 add | Open files in a client workspace for addition to the depot. |
| p4 attribute | Set per-revision attributes on revisions: name-value pairs that associate metadata with the file revision. |
| p4 copy | Copy files and/or the stream spec from one location in the depot to another. |
| p4 delete | Open files in a client workspace for deletion from the depot. |
| p4 diff | Diff utility for comparing workspace content to depot content. (For comparing two depot paths, see p4 diff2.) Also for stream spec comparison. |
| p4 diff2 | Diff utility for comparing the content at two depot paths. (For comparing workspace content to depot content, see p4 diff.) |
| List the immediate subdirectories of the specified depot directories. | |
| p4 edit | Opens files in a client workspace for edit, or open the current stream spec. |
| p4 files | Provide information about files in the depot without accessing their contents. |
| p4 fstat | Dump file information in a tagged format that is suitable for parsing by scripts. |
| p4 grep | Print lines in files (or revisions of files) that match a pattern. |
| p4 hotfiles | Edit the hotfiles mapping table for altsync client workspaces. |
| p4 lock | Lock an opened file against other users submitting changes to the file. |
| Move (rename) a file from one location to another within the branch. | |
| p4 print | Print the contents of a depot file revision. |
| p4 reconcile | Open files for add, delete, or edit to reconcile a workspace with changes made outside of P4 Server. You might need to use this command after working offline from P4 Server. |
| p4 rename | The command p4 rename is an alias for p4 move. |
| p4 revert | Discard changes made to open files or revert an open stream spec. |
| p4 sizes | Display size information for files in the depot. |
| Previews output of open files for add, delete, and/or edit in order to reconcile a workspace with changes made outside of P4 Server. | |
| p4 unlock | Release the lock on one or more files. |
See Git repo commands for commands related to working with Git.
|
Command |
Description |
|---|---|
| p4 job | Create or edit an instance of a job, such as a defect or enhancement request. |
| List jobs known to the P4 Server. | |
| p4 jobspec | Edit the jobs template to change, add, or remove spec fields for job forms. |
|
Command |
Description |
|---|---|
| p4 login | Report changed jobs and changelists. |
| p4 login2 | Perform multi-factor authentication (MFA), formerly known as second factor authentication (2fa). |
| Log out a user of the P4 Server by removing a ticket on the user’s workstation, or by invalidating the user's ticket on the server. | |
| p4 passwd | Change the P4 Server password of a user. |
| Control user access to files, directories, and commands. | |
| Display protections in place for a given user, group, or path. | |
| p4 tickets | Display all tickets granted to a user by p4 login. |
| p4 trust | Establish trust of an SSL/TLS connection to a Perforce service. |
| Create, edit, or delete P4 Server user specifications and preferences. | |
| p4 users | Print a list of all known users of the current Perforce service. |
| P4CLIENTPATH | A list of directories to which P4 Server applications are permitted to write. |
| P4SSLDIR | Directory containing a server’s SSL/TLS keys and/or certificates. |
| P4TRUST | Specifies the path to the SSL/TLS trust file. |
|
Command |
Description |
|---|---|
| p4 istat | Check for integrations needed for stream files, the stream spec, or both. |
| p4 prune | Removes unmodified files from a stream. |
| p4 stream | Create, edit, delete, or obliterate an instance of a stream An enhanced type of branch with a dedicated view for clients of the stream (see 'stream view') and built-in rules that determine how changes flow across the stream depot (see 'stream hierarchy'). A stream specification defines a stream. In P4V, stream specs are visible in the Streams Graph and the Streams tab. (also known as a stream definition or stream spec). |
| p4 streamlog | List revision history of streams. |
| p4 streams | Display a list of streams. |
| p4 streamspec | Edit the streams template to change, add, or remove spec fields for stream forms. |
| p4 switch | Create a stream, or switch to a different stream, with an option to populate that stream, or to display current streams. |
|
Command |
Description |
|---|---|
| Global options | Global options for P4 Server commands can be supplied on the command line before any P4 Server command. |
| File specifications | Any file can be specified within any P4 Server command in client syntax, depot syntax, or local syntax. |
| p4 stream | Create, edit, delete, or obliterate an instance of a stream An enhanced type of branch with a dedicated view for clients of the stream (see 'stream view') and built-in rules that determine how changes flow across the stream depot (see 'stream hierarchy'). A stream specification defines a stream. In P4V, stream specs are visible in the Streams Graph and the Streams tab. (also known as a stream definition or stream spec). |
| p4 streamlog | List revision history of streams. |
| Display a list of streams. | |
| Edit the streams template to change, add, or remove spec fields for stream forms. | |
| p4 switch | Create a stream, or switch to a different stream, with an option to populate that stream, or to display current streams. |