---
name: "pmlock"
section: "1"
platform: "linux"
package: "pcp"
version: "7.2.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pmlock"
---

# pmlock(1)

simple file-based mutex

## NAME

**pmlock** - simple file-based mutex

## SYNOPSIS

**$PCP\_BINADM\_DIR/pmlock** \[**-i** *ident*\] \[**-v**\] *file*

## DESCRIPTION

**pmlock** attempts to acquire an exclusive lock by creating a zero-sized *file* with a mode of 0.

The *-i* option changes the behaviour to write *ident* into *file*, followed by a newline and the file mode is 0444. *ident* is an arbitrary string, but by convention it is the process id of the locker followed by the name or identification of the locker command or script.

The exit status is 0 for success, 1 for failure.

To release the lock, remove *file* with [**rm**(1)](/rm/1.md) or [**unlink**(2)](/unlink/2.md).

In the event of a failure, the **-v** option produces an explanatory message on *stderr*.

## SEE ALSO

[**rm**(1)](/rm/1.md) and [**unlink**(2)](/unlink/2.md).
