ipcrm Command

Purpose

Removes message queue, semaphore set, or shared memory identifiers.

Syntax

ipcrm [ -m SharedMemoryID ] [ -M SharedMemoryKey ] [ -q MessageID ] [ -Q MessageKey ] [ -s SemaphoreID ] [ -S SemaphoreKey ] [ -@ WparName ]

ipcrm -r {-q|-m|-s} [ -@ WparName ] Name

ipcrm -r -u [-o Owner] [-g Group] [ -@ WparName ]

Description

The ipcrm command removes one or more message queues, semaphore sets, or shared memory identifiers.

Note: The -@ option is not supported when executed within a workload partition.

Flags

Item Description
-g Group Restricts the removal to unnamed semaphores matching the group specified.
-m SharedMemory ID Removes the shared memory identifier SharedMemoryID. The shared memory segment and data structure associated with SharedMemoryID are also removed after the last detach operation.
-M SharedMemoryKey Removes the shared memory identifier, created with the key SharedMemoryKey. The shared memory segment and data structure associated with it are also removed after the last detach operation.
-o Owner Restricts the removal to unnamed semaphores matching the owner specified.
-q MessageID Removes the message queue identifier MessageID and the message queue and data structure associated with it.
-Q MessageKey Removes the message queue identifier, created with the key MessageKey, and the message queue and data structure associated with it.
-r Removes named or unnamed real-time interprocess communication objects. The named real-time object is either a real-time message queue (-q), a real-time shared memory (-m), or a real-time semaphore (-s) and is identified by its Name.
-s SemaphoreID Removes the semaphore identifier SemaphoreID and the set of semaphores and data structure associated with it.
-S SemaphoreKey Removes the semaphore identifier, created with the key SemaphoreKey, and the set of semaphores and data structure associated with it.
-u Removes all real-time unnamed semaphores. Using a descriptor on a destroyed unnamed semaphore can result in unspecified behavior.
-@ WparName Removes the specified interprocess-communication construct within workload partition WparName.

The msgctl, shmctl, and semctl subroutines provide details of the remove operations. The identifiers and keys can be found by using the ipcs command.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

To remove the shared memory segment associated with SharedMemoryID 18602, enter:

ipcrm -m 18602