Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

112 lines (111 sloc) 3.594 kb
.\" Copyright 2002 Andre C. Mazzone (
.\" May be distributed under the GNU General Public License
.TH IPCRM "1" "September 2011" "util-linux" "User Commands"
ipcrm \- remove a message queue, semaphore set or shared memory id
.B ipcrm
.B ipcrm
.I <shm|msg|sem> <id>
.I ipcrm
removes System V interprocess communication (IPC) objects
and associated data structures from the system.
In order to delete such objects, you must be superuser, or
the creator or owner of the object.
System V IPC objects are of three types: shared memory,
message queues, and semaphores.
Deletion of a message queue or semaphore object is immediate
(regardless of whether any process still holds an IPC
identifier for the object).
A shared memory object is only removed
after all currently attached processes have detached
.RB ( shmdt (2))
the object from their virtual address space.
Two syntax styles are supported. The old Linux historical syntax specifies
a three letter keyword indicating which class of object is to be deleted,
followed by one or more IPC identifiers for objects of this type.
The SUS-compliant syntax allows the specification of
zero or more objects of all three types in a single command line,
with objects specified either by key or by identifier. (See below.)
Both keys and identifiers may be specified in decimal, hexadecimal
(specified with an initial '0x' or '0X'), or octal (specified with
an initial '0').
\fB\-M\fR, \fB\-\-shmem\-key\fR \fIshmkey\fR
removes the shared memorysegment created with
.I shmkey
after the last detach is performed.
\fB\-m\fR, \fB\-\-shmem\-id\fR \fIshmid\fR
removes the shared memory segment identified by
.I shmid
after the last detach is performed.
\fB\-Q\fR, \fB\-\-queue\-key\fR \fImsgkey\fR
removes the message queue created with
.IR msgkey .
\fB\-q\fR, \fB\-\-queue\-id\fR \fImsgid\fR
removes the message queue identified by
.IR msgid .
\fB\-S\fR, \fB\-\-semaphore\-key\fR \fIsemkey\fR
removes the semaphore created with
.IR semkey .
\fB\-s\fR, \fB\-\-semaphore\-id\fR \fIsemid\fR
removes the semaphore identified by
.IR semid .
\fB-a\fR, \fB\-\-all\fR [\fIshm msg sem\fR]
Remove all resources. When option argument is provided the removal is
performed only to for the specified resource types. Warning! Do not use
.B \-a
if you are unsure how the software using resources might react on missing
objects. Some programs create these resources at start up and may not have
any code to deal unexpected disappearance.
The details of the removes are described in
.IR msgctl (2),
.IR shmctl (2),
.IR semctl (2).
The identifiers and keys may be found by using
.IR ipcs (1).
In its first Linux implementation, ipcrm used the deprecated syntax
shown in the
Functionality present in other *nix implementations of ipcrm has since
been added, namely the ability to delete resources by key (not just
identifier), and to respect the same command-line syntax. For backward
compatibility the previous syntax is still supported.
.\" Andre C. Mazzone (
.\" .br
.\" Krishna Balasubramanian (
.BR ipcs (1),
.BR ipcmk (1),
.BR msgctl (2),
.BR msgget (2),
.BR semctl (2),
.BR semget (2),
.BR shmctl (2),
.BR shmdt (2),
.BR shmget (2),
.BR ftok (3)
The ipcrm command is part of the util-linux package and is available from
.UR ftp://\\:/pub\:/linux\:/utils\:/util-linux/
Linux Kernel Archive
.UE .
Jump to Line
Something went wrong with that request. Please try again.