### P4 CLI Output Example Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/tutorial.start-client.html Example output shown after starting the P4 CLI, indicating a successful launch and providing basic information. ```text Perforce P4 -- Scalable Version Control for Any Digital Asset p4 is the command-line client. ``` -------------------------------- ### Client Syntax Example Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/filespecs.html Specifies a file in client syntax, starting with '//' followed by the workspace name and path. ```shell //myworkspace/file.c ``` -------------------------------- ### Depot Syntax Example Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/filespecs.html Specifies a file in depot syntax, starting with '//' followed by the depot name and path. ```shell //depot/source/module/file.c ``` -------------------------------- ### Create Extension Sample Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_extension.html Generates a sample P4 Extension to get started. Replace _extName_ with your desired extension name. ```bash p4 extension --sample _extName_ ``` -------------------------------- ### Example Client Workspace Specification Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_client.html This example demonstrates how to configure a client workspace specification, particularly for multi-drive setups on Windows. Note the use of 'null' for the Root and lowercase drive letters in the View mapping. Comments are indicated by '##'. ```Perforce Spec Client: eds_win Owner:  edk Description:         Ed's Windows Workspace Root:   null Options:        nomodtime noclobber SubmitOptions:  submitunchanged View:          ## Comment line         //depot/main/...     "//eds_win/c:/Current Release/..."         //depot/rel1.0/...   //eds_win/d:/old/rel1.0/...  ## Comment appended         //depot/rel2.0/...   //eds_win/d:/old/rel2.0/... ``` -------------------------------- ### Example: View Specific Configurable Value Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html This example shows how to view the value of a specific configurable variable, 'monitor', and indicates how it was set. ```bash p4 configure show monitor ``` -------------------------------- ### Example: Configurable set by p4d startup option Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html This example shows a configurable variable that was set using a command-line option during the p4d server startup. ```bash P4PORT=20192 (-p) ``` -------------------------------- ### Example: View Configurable Values on All Servers Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html This example demonstrates how to view configuration variables across all servers, including those defined for 'any' server and specific named servers. ```bash p4 configure show allservers ``` -------------------------------- ### Example Output of `p4 opened` Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/scripting.file-reporting.listopen.html This is an example of the output displayed by the `p4 opened` command, showing a file opened for editing. ```bash //JamCode/dev/jam/fileos2.c- edit default change (text) ``` -------------------------------- ### Example: Configurable set by p4 serverid Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html This example shows a configurable variable that was set using the 'p4 serverid' command. ```bash serverid=commit (serverid) ``` -------------------------------- ### Install Packaged Extension Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_extension.html Use --install to install a packaged Extension file server-side. The --yes option is required to perform the installation; without it, the command only reports what it would do. ```bash p4 extension --install _ExtName_.p4-extension --yes ``` -------------------------------- ### Example: Setting Configurable with p4 configure set Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html This example demonstrates setting a configurable variable using the 'p4 configure set' command, which provides persistent configuration. ```bash net.parallel.max: 10 (configure) ``` -------------------------------- ### Start P4 Web Server with IP Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_webserver.html Starts the P4 Web Server on a specific IP address and port. The IP address is optional. ```bash p4 webserver start -p 192.168.1.100:1666 ``` -------------------------------- ### Start P4 Web Server Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_webserver.html Starts the P4 Web Server on the specified port. The IP address is optional. ```bash p4 webserver start -p 1666 ``` -------------------------------- ### Example Output of `p4 set` Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_set.html This example shows the typical output of the `p4 set` command, illustrating how variable values are displayed along with their source of definition (e.g., config, enviro, set, set -s). ```text P4CLIENT=symlinks-nix (config) P4CONFIG=p4config.txt (config '/home/perforce/p4clients/symlinks-nix/p4config.txt') P4EDITOR=/usr/bin/vi P4IGNORE=p4ignore.txt (enviro) P4PORT=win-bruno:20151 (config) P4USER=bruno (set -s) P4_20151_CHARSET=none (set) ``` -------------------------------- ### Install P4 Extension Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_extension.html Installs a P4 Extension from a .p4-extension file. The --yes flag bypasses confirmation. ```bash p4 extension --install _extName_.p4-extension [--yes] ``` -------------------------------- ### Example: Configurable set by p4d -v option Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html This example shows a configurable variable that was set using the '-v' option during the p4d server startup. ```bash monitor=2 (-v) ``` -------------------------------- ### Example: Setting Configurable via Environment Variable (Unix) Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html This example shows how to set a server-related configurable using the 'export' command on Unix. Note that this method does not persist across sessions. ```bash export P4PORT=20192 ``` -------------------------------- ### Install Unsigned Extension Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_extension.html Use --allow-unsigned to install an extension without requiring it to be signed, equivalent to setting 'server.extensions.allow.unsigned=1'. ```bash p4 extension --install _ExtName_.p4-extension --yes --allow-unsigned ``` -------------------------------- ### Example p4 aliases output Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_aliases.html This example shows the typical output format for the 'p4 aliases' command, illustrating various custom alias definitions. ```bash p4 aliases co => edit ci => submit st => status shelved => changes -s shelved -u $(P4USER) -c $(P4CLIENT) pending => changes -s pending -u $(P4USER) -c $(P4CLIENT) desc => describe -s purge => clean -I blame => annotate -u delete-shelf $(change) => shelve -dc $(change) && revert -c $(change) //... && change -d $(change) newChange $(desc) => change -o > $(chg) && p4subst "$(LT)enter.*$(GT)" $(desc) < $(chg) > $(chg2) && change -i < $(chg2) ``` -------------------------------- ### Start P4 Server (Unix/macOS) Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/tutorial.start-server.html Starts the Perforce shared server on Unix-like systems, specifying the repository directory and the listening port. ```bash p4d -r /Users/bruno/server -p localhost:1666 ``` -------------------------------- ### Navigate to Download Directory Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/install.unix.html Change to the directory where you want to install the P4 CLI. ```bash cd /usr/local/bin ``` -------------------------------- ### Hotfiles mapping examples Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_hotfiles.html This example demonstrates various ways to define hotfiles mappings, including specifying depot paths, filetypes, and size constraints. Paths can be repeated for different rules. ```text HotFiles: //depot/project1/...  //depot/project2/... text //depot/project3/... <50K //depot/project4/... text+C <100K //depot/project4/... binary <1M ``` -------------------------------- ### Combined p4 opened options Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_opened_graph.html Example demonstrating the combination of options. This specific example lists files opened by a user in a specific workspace, limited to a maximum number of results. ```bash p4 opened -a -c _change_ -C _workspace_ -u _user_ -m _max_ -s [_file_ ...] ``` -------------------------------- ### List Installed Extensions and Configurations Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_extension.html Use --list to display installed extensions and their instances. Filter by --type (extensions, configs, global, instance) or --path for path-based instances. ```bash p4 extension --list --type extensions ``` ```bash p4 extension --list --type configs ``` ```bash p4 extension --list --type global ``` ```bash p4 extension --list --type instance ``` ```bash p4 extension --list --path //depot/... ``` -------------------------------- ### Example Output: File Transfers Summary Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_pull.html This example output illustrates the information provided by 'p4 pull -l -s', detailing the number of active and total file transfers and bytes. ```text File transfers: 1 active/63 total, bytes: 745 active/23684 total. ``` -------------------------------- ### Get Help for a Specific Graph Command Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_help-graph.html To get detailed information about a particular graph depot command, specify the command name after 'p4 help-graph'. For example, to get help for the 'add' command. ```bash p4 help-graph add ``` ```bash p4 help-graph switch ``` -------------------------------- ### Example output for p4 have on a graph depot Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_have_graph.html This example shows the typical output of 'p4 have' for a graph depot, including the repository, workspace, commit SHA, and branch name. It also illustrates how file-specific revisions are displayed when they differ from the branch commit. ```text //graphDepot1/repo1 workspace1 b78d7fb2e8c50e refs/heads/branch File specific revisions: workspace1 readme.txt 3a16b5c563e01a workspace1 index.html 3a16b5c563e01a workspace1 eiffel-tower.png f2d7b9b83a49d ``` -------------------------------- ### Example of p4 graph verify Output Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_graph_verify.html This example shows the typical output format when verifying a repository. Each line represents a file, displaying its computed SHA1 and its location within the repository's object storage. ```bash p4 graph verify -n //gd1/repo1 e69de29bb2d1d6434b8b29ae775ad8c2 gd1/repo1.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2 ``` -------------------------------- ### Client View Mapping Example Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/views.html Demonstrates how a client view maps depot files to workspace files, showing how later mappings override earlier ones. ```text //depot/... //ws/... ``` ```text //depot/dir/... //ws/dir2/... ``` -------------------------------- ### Example Output of p4 sync with a Label Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/labels.revision.html This is an example of the output you might see when syncing files using a label. It shows files being updated or added in your client workspace. ```text //JamCode/dev/jam/Build.com#5 - updating c:\bruno_ws\dev\jam\Build.com //JamCode/dev/jam/command.c#5 - updating c:\bruno_ws\dev\jam\command.c //JamCode/dev/jam/command.h#3 - added as c:\bruno_ws\dev\jam\command.h //JamCode/dev/jam/compile.c#12 - updating c:\bruno_ws\dev\jam\compile.c //JamCode/dev/jam/compile.h#2 - updating c:\bruno_ws\dev\jam\compile.h ... ``` -------------------------------- ### List Repositories with Name Filter Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_repos.html Use the `-e` option to filter repositories by name pattern. This example lists repos where the depot name starts with 'gra' and the repo name starts with 'rep'. ```bash p4 repos -e //gra.../rep... ``` -------------------------------- ### Example Resolve Prompt and Automated Resolution Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_resolve.html This example demonstrates the interactive prompt during a merge and how automated resolution options like 'at' (accept theirs) or 'ay' (accept yours) can be used to handle different types of conflicts, such as filetype changes or moves. ```text Merging //depot/rel/fileb#1 Diff chunks: 1 yours + 0 theirs + 0 both + 0 conflicting Accept(a) Edit(e) Diff(d) Merge (m) Skip(s) Help(?) ay: m //depot/main/filez - resolve skipped. Resolving move to //depot/main/fileb Filename resolve: at: //depot/main/fileb ay: //depot/main/filez ``` -------------------------------- ### Perforce Workspace View Mapping Example Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/configuration.workspace_view.mapping.html This example shows how to define a workspace view with two mappings. The second mapping overrides the first, demonstrating how later mappings take precedence. ```Perforce View: //Acme/dev/... //bruno_ws/dev/... //Acme/dev/docs/... //bruno_ws/docs/... ``` -------------------------------- ### Get Current Version of Specified Tables Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_dbschema.html To get the current schema for specific tables, list their names after the `p4 dbschema` command. Table names correspond to files starting with `db.` in the P4 Server root directory. ```bash p4 dbschema db.rev db.have ``` -------------------------------- ### Create and switch to a branch on all repos Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_switch_graph.html This example shows how to create a new branch and switch all associated repositories to that branch using the -c and -a options. ```bash p4 switch -c -a branch2 ``` -------------------------------- ### Example: Sync and check have revision Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_have.html This example demonstrates syncing a specific revision of a file and then using 'p4 have' to confirm the revision currently in the client workspace. The first 'p4 have' shows the highest revision copied, and the second 'p4 have' confirms the specific revision synced. ```bash p4 sync //depot/name/...#4 p4 have //depot/name ``` -------------------------------- ### Display all versions of CommandStart record type Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_logschema.html This example displays all versions for the tagged output of the CommandStart record type, including version 0 and version 50. ```bash p4 logschema -A 0 ``` -------------------------------- ### List all opened files in depot syntax Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_opened.html This example demonstrates listing all files under a specific depot path using depot syntax. This is useful for checking the status of files in a particular project or directory within the depot. ```bash p4 opened -a //depot/project1/... ``` -------------------------------- ### Filter Keys by Name Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_keys.html Lists keys whose names match the specified pattern. For example, to list all keys starting with 'mycounter-'. ```bash p4 keys -e 'mycounter-*' ``` -------------------------------- ### Example Protection Table Configuration Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_protect.html This example shows a protection table configuration with multiple users and access levels. It defines permissions for 'alice' and 'bob' on different depot paths and grants 'super' access globally. ```Perforce Protection Table list user * * -//... write user alice * //depot/dev/... write user alice * //depot/main/... write user bob * //depot/dev/... open user bob * //depot/main/... super user super * //... ``` -------------------------------- ### Filter Counters by Name Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_counters.html Lists counters whose names match the specified pattern. For example, to list all counters starting with 'mycounter-'. ```bash p4 counters -e 'mycounter-*' ``` -------------------------------- ### Display General Help for P4 Server Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_help.html Use this command without arguments to list all available 'p4 help' options and topics. ```bash p4 help ``` -------------------------------- ### Wildcard: //gra*/dep* Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/filespecs.html Matches depot paths starting with 'gra' and 'dep'. This example illustrates matching across directory names. ```shell //gra*/dep* ``` -------------------------------- ### Set Server Configurable via Command Line Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/appendix.configurables.html Use command-line options with `p4d` to set server configurables at startup. This method is not persistent. ```bash p4d -v net.keepalive.idle=2700 ``` -------------------------------- ### Filter and Limit Counters Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_counters.html Combines filtering by name pattern and limiting the number of results. This example lists the first 10 counters that start with 'build-'. ```bash p4 counters -e 'build-*' -m 10 ``` -------------------------------- ### Filter and Limit Keys Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_keys.html Combines filtering by name pattern with a limit on the number of keys displayed. For example, to list a maximum of 5 keys that start with 'test-'. ```bash p4 keys -e 'test-*' -m 5 ``` -------------------------------- ### p4 login2 Syntax Examples Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_login2.html Demonstrates the various syntaxes for the p4 login2 command, including options for multi-factor authentication persistence, status display, restarting MFA, and forwarding authentication to remote servers. ```bash p4 login2 [ -p -R ] [ -h _host_ ] [ -S _state_ ] [ -m _method_ ] [ _username_ ] ``` ```bash p4 login2 -s [ -a | -h _host_ ] [ _username_ ] ``` ```bash p4 login2 [-p] -r _remotespec_ [--remote-user=_X_] ``` ```bash p4 login2 [-s -a] -r _remotespec_ [--remote-user=_X_] ``` -------------------------------- ### Add users to a group Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_pubkey.html Example of adding users to a specified group using the `p4 group` command. This is part of the setup required for users to manage their SSH keys. ```bash **p4 group repoUsers** ``` -------------------------------- ### Changelist Details (Z-Tag Output) Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_describe.html Example output of 'p4 -ztag describe' showing detailed changelist information in a structured format. Each line starts with '... ' followed by a tag and its value. ```bash ... change 2 ... user bruno ... client brn123 ... time 1546621943 ... desc x ... status pending ... changeType public ... stream //root/main ``` -------------------------------- ### Set a Server Startup Configuration Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html Sets a specific startup script for a named server. This example configures 'Replica1' to pull data every second. ```bash p4 configure set "Replica1#startup.1=pull -i 1" ``` -------------------------------- ### Install P4 Extension Certificate Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_extension.html Installs a certificate for a P4 Extension. Includes an optional comment. ```bash p4 extension --install _certificateFile_ --cert [ --comment ] ``` -------------------------------- ### Get Help on a Specific P4 Keyword Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_help.html Use this command with a keyword to get help on that specific topic. ```bash p4 help _keyword_ ``` -------------------------------- ### Start P4 Server Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/basic-tasks.initial.start-server.html Launch the P4 server using the `p4d` command, specifying the server root directory with the `-r` option. The server will create necessary database files if they don't exist. ```bash p4d -r /Users//server ``` -------------------------------- ### Get Help on P4 Server Configurables Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_help.html This command describes the usage of all P4 Server configuration variables. ```bash p4 help configurables ``` -------------------------------- ### Get Help on a Specific P4 Command Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_help.html Use this command with a command name to get specific help for that command. ```bash p4 help _command_ ``` -------------------------------- ### Initialize a new P4 Server Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_init.html Initializes a new P4 Server personal server. This command sets up the necessary files and directories for a local P4 Server instance. ```bash p4 init ``` -------------------------------- ### Create Extension Skeleton Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_extension.html Use --sample to create a skeleton of a new Extension in a directory. Pass it the name of the Extension to be created. ```bash p4 extension --sample _ExtName_ ``` -------------------------------- ### DistributedConfig Form Example with Indentation Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/specification-forms.html Shows an example of a 'DistributedConfig' field in a specification form, demonstrating indented values. ```text DistributedConfig: P4TARGET=host7:1234 track=1 ``` -------------------------------- ### Start P4 Server (Windows) Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/tutorial.start-server.html Starts the Perforce shared server on Windows, specifying the repository directory and the listening port. ```batch p4d -r C:\Users\bruno\server -p localhost:1666 ``` -------------------------------- ### Create and Change to a Working Directory Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/basic-tasks.initial.working-dir.html Use these commands to create a new directory and then navigate into it. Replace and with your specific details. ```bash mkdir /Users// cd /Users// ``` ```bash mkdir /Users/bruno/work cd /Users/bruno/work ``` -------------------------------- ### Example Configuration History Output Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html Illustrates the typical output format of the 'p4 configure history' command, showing configuration variable changes. ```text any#dm.user.setinitialpasswd changed from 'unset' to '0' (iteration 1) by 'usuper' on 2022/10/17 01:54:55 local to server NoServerId with comment 'security' any#server.allowfetch changed from 'unset' to '1' (iteration 2) by 'usuper' on 2023/10/20 10:22:55 local to server NoServerId any#server.allowfetch changed from '1' to 'unset' (iteration 3) by 'usuper' on 2023/10/31 17:28:45 local to server NoServerId with comment 'unset fetch' ``` -------------------------------- ### Stream Depot Specification Example Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/basic-tasks.initial.create-depot.html This is an example of a Perforce stream depot specification. Ensure lines below field names are indented. ```text # A Perforce Depot Specification. # #  Depot:       The name of the depot. #  Owner:       The user who created this depot. #  Date:        The date this specification was last modified. #  Description: A short description of the depot (optional). #  Type:        Whether the depot is 'local', 'remote', #               'stream', 'spec', 'archive', 'tangent', #               or 'unload'.  Default is 'local'. #  Address:     Connection address (remote depots only). #  Suffix:      Suffix for all saved specs (spec depot only). #  StreamDepth: Depth for streams in this depot (stream depots only). #  Map:         Path translation information (must have ... in it). #  SpecMap:     For spec depot, which specs should be recorded (optional). # # Use 'p4 help depot' to see more about depot forms. Depot:          JamCode Owner:          bruno Date:           2016/02/22 13:20:06 Description:     Use a tab to indent any lines below the field name! Type:           stream StreamDepth:    //JamCode/1 Map:            JamCode/... ``` -------------------------------- ### Basic Workspace View Mapping with Wildcard Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/P4Guide/configuration.workspace_view.wildcards.html This example demonstrates a simple workspace view mapping using the '...' wildcard to map all files in the depot's 'dev' stream to corresponding locations in the client workspace. ```Perforce //JamCode/dev/... //bruno_ws/dev/... ``` -------------------------------- ### P4TARGET Examples Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/P4TARGET.html Examples of valid P4TARGET values, including port numbers, hostnames with ports, and IP addresses with ports. ```text 1818 ``` ```text london:11111 ``` ```text perforce.example.com:1234 ``` ```text 192.168.0.123:1818 ``` -------------------------------- ### Get Introduction to P4 Streams Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_help.html This command explains what streams are in P4 Server and lists commands typically used with them. ```bash p4 help streamintro ``` -------------------------------- ### Basic p4 integrate Example Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_integrate.html The simplest syntax for integrating changes from one file to another. If the target file does not exist, it's copied. If it exists, it's opened for integration, requiring 'p4 resolve'. ```bash p4 integrate _fromFile toFile_ ``` -------------------------------- ### Example Audit Log Entries Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/P4AUDIT.html These are example lines from the P4 Server audit log, illustrating the format for 'diff' and 'sync' commands. ```text 2025/06/09 09:52:45 maria@mgonzales-ws1 192.168.0.12 diff //depot/src/x.c#1 2025/06/09 09:54:13 emily@emonti-ws2 127.0.0.1 sync //depot/inc/file.h#1 ``` -------------------------------- ### List all client workspaces (not just local) Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_clients.html Use the -a option to list all client workspaces, not just those bound to the current server. ```bash p4 clients -a ``` -------------------------------- ### Install a Fingerprint Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_trust.html Use the `-i` option to install a specified fingerprint into the `P4TRUST` file. This is necessary when manually adding a server's fingerprint. ```bash p4 trust -i "_fingerprint_" ``` -------------------------------- ### Show File Locations Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_where.html Example of using p4 where to display the depot, client workspace, and local filesystem locations for a specific file. ```bash p4 where file.c ``` -------------------------------- ### Example Updated Configuration History Output Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_configure.html Shows the 'p4 configure history' output after a comment has been added to a specific iteration. ```text any#dm.user.setinitialpasswd changed from 'unset' to '0' (iteration 1) by 'usuper' on 2022/10/17 01:54:55 local to server NoServerId with comment 'security' any#server.allowfetch changed from 'unset' to '1' (iteration 2) by 'usuper' on 2023/10/20 10:22:55 local to server NoServerId with comment 'for DVCS' any#server.allowfetch changed from '1' to 'unset' (iteration 3) by 'usuper' on 2023/10/31 17:28:45 local to server NoServerId with comment 'unset fetch' ``` -------------------------------- ### Example p4 resolved Output Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_resolved.html An example of how the output might look, showing a file that was merged from a specific depot path and revision range. ```text my/local/file.txt - merge from //depot/main/file.txt#1-5 ``` -------------------------------- ### Example P4 Info Output Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_info.html This is an example of the output generated by the `p4 info` command, showing various details about the Perforce server configuration. ```text Client name: myserver-24-n102 Client host: myserver-24-n102.dhcp.perforce.com Client unknown. Current directory: /Users/kharris Peer address: 10.0.102.24:52492 Client address: 10.0.102.24 Server address: someaddress.perforce.com:1999 Server root: /depots/p4-1999 Server date: 2025/07/13 14:52:59 -0700 PDT Server uptime: 147:34:34 Server version: P4D/LINUX26X86_64/2025.2.MAIN-TEST_ONLY/1199094 (2025/07/07) ServerID: london1999 Server services: standard Server license: 500 users (expires 2027/01/31) Server license-ip: qaplay.perforce.com Case Handling: sensitive ``` -------------------------------- ### Get Tagged Output for Groups Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_groups.html Use the -ztag option with p4 groups to get tagged output, which includes the Description field and other group details. ```bash p4 -ztag groups ``` -------------------------------- ### Starting P4D with Journal File Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/P4JOURNAL.html This command-line alternative specifies the journal file when starting the P4D server. It is the server-side equivalent of setting the P4JOURNAL variable. ```bash p4d -J _file_ ``` -------------------------------- ### Configure Extension Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_extension.html Use --configure to activate an Extension by creating its instance configuration. The _extFQN_ is the fully-qualified name (namespace:name[:revision]). The --revision option specifies which depot version to configure. Use -o to write the definition to stdout and -i to read from stdin. ```bash p4 extension --configure _extFQN_ [ --revision=_n_ ] [ -o | -i ] ``` ```bash p4 extension --configure _ExampleInc_::_myExt_ ``` ```bash p4 extension --configure myCompany::fileSizeCheck ``` ```bash p4 extension --configure _myCompany_::_extName_ --name Release1.0-fileSizeCheckInst ``` -------------------------------- ### Stream Spec Ditto Mapping Example - Paths Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_stream.html Example configuration for mapping paths in a stream spec, including sharing and importing with platform-specific directories. ```text Paths: share ... import& dirWindows/Lib1 //other/main/dirA/fileA import& dirLinux/Lib1 //other/main/dirA/fileA ``` -------------------------------- ### p4 branch View Example Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_branch.html Illustrates how to define a branch view, mapping files from one depot location to another. Comments can be added using '##'. ```bash View: ## Comment line //depot/main/... //depot/r2.1 ## comment appended ``` -------------------------------- ### DistributedConfig Example Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_server.html Example of setting non-default values for distributed configuration in Perforce Helix Core Server. This includes setting P4TARGET and track options. ```shell DistributedConfig: P4TARGET=host7:1234 track=1 ``` -------------------------------- ### Example output of fstat -Oa Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_fstat.html This is an example output of the 'p4 fstat -Oa' command, showing various file metadata and attributes, including 'attr-black-and-white'. ```text ... depotFile //depot/main/release1/perl_proj/kitten.gif ... clientFile /home/bruno/main/release1/perl_proj/kitten.gif ... isMapped ... headAction edit ... headType text ... headTime 1422908282 ... headRev 4 ... headChange 25424 ... headModTime 1422908084 ... attr-black-and-white true ``` -------------------------------- ### Display CommandStart record type Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_logschema.html This example displays the tagged output for the CommandStart record type of the commands.csv log file. ```bash p4 logschema 0 ``` -------------------------------- ### Configure background task on server startup Source: https://help.perforce.com/helix-core/server-apps/cmdref/current/Content/CmdRef/p4_bgtask.html Configure a background task to run automatically upon server startup using the startup.N configurable. This example sets up the 'log_checker' task. ```bash startup.1=bgtask -t log_checker ```