This chapter tells you how to install the Perforce Command-Line Client (p4) on your workstation. For details about installing the Perforce versioning service, refer to the Perforce Server Administrator's Guide: Fundamentals.
Installing P4 on UNIX and OS X
To install the Perforce Command-Line Client (p4) on a UNIX or Mac OS X machine, perform the following steps:
Download the p4 executable file from the Perforce web site:
Perforce applications are typically installed into
Make the p4 file executable (chmod +x p4).
Configure the port setting, client workspace name, and user name. You can specify these settings by configuring the
P4USERenvironment variables. (For details, see “Configuring P4”.)
Installing P4 on Windows
To install the Perforce Command-Line Client (p4.exe) on Windows, download and run the Perforce Windows installer (perforce.exe) from the Downloads page of the Perforce web site:
The Perforce installer enables you to install and uninstall the Perforce Command-Line Client and other Perforce Windows components.
Verifying the installation
To verify that you have successfully installed the Perforce Command-line Client, type p4 info at the command line and press ENTER. If the Perforce service is running on the specified host and port, the following message is displayed:
User name: ona Client name: ona-agave Client host: agave Client root: /home/ona/p4-ona Current directory: /home/ona/p4-ona Client address: 10.0.0.196 Server address: perforce:1666 Server root: /usr/depot/p4d Server date: 2012/03/28 12:11:47 -0700 PDT Server uptime: 752:41:33 Server version: P4D/FREEBSD/2012.1/406375 (2012/01/25) Server license: P4Admin <p4adm> 20 users (expires 2013/01/01) Server license-ip: 10.0.0.2 Case handling: sensitive
If your configuration settings are incorrect, an error message is displayed:
Perforce client error: Connect to server failed; check $P4PORT. TCP connect to <hostname> failed. <hostname>: host unknown.
If your administrator has configured Perforce to require SSL, the first time you attempt to connect to the Perforce service, you will need to verify the server's fingerprint. See SSL-encrypted connections.