The command line syntax to delete files in Perforce

command-linefileperforcesyntax

I am creating some build scripts that interact with Perforce and I would like to mark for delete a few files. What exactly is the P4 syntax using the command line?

Best Solution

p4 delete filename

(output of p4 help delete)

delete -- Open an existing file to delete it from the depot

p4 delete [ -c changelist# ] [ -n ] file ...

Opens a file that currently exists in the depot for deletion.
If the file is present on the client it is removed.  If a pending
changelist number is given with the -c flag the opened file is
associated with that changelist, otherwise it is associated with
the 'default' pending changelist.

Files that are deleted generally do not appear on the have list.

The -n flag displays what would be opened for delete without actually
changing any files or metadata.