.TH ipcrm "" "" Command
.PC "Remove an interprocess-communication memory item"
\fBipcrm [\-mqs \fIid\^\fB] [\-MQS \fIkey\^\fB]\fR
.PP
.HS
.SH Options:
.IC "\fBm \fIid\fR"
Remove the shared memory segment with an identifier of \fIid\fR.
.IC "\fBq \fIid\fR"
Remove the message queue with an identifier of \fIid\fR.
.IC "\fBs \fIid\fR"
Remove the semaphore set with an identifier of \fIid\fR.
.IC "\fBM \fIkey\fR"
Remove the shared memory segment with a key of \fIkey\fR.
.IC "\fBQ \fIkey\fR"
Remove the message queue with a key of \fIkey\fR.
.IC "\fBS \fIkey\fR"
Remove the semaphore set with a key of \fIkey\fR.
.HE
The command
.B ipcrm
removes a memory item used for interprocess communication:
either shared-memory segment, message queue, or semaphore set.
You can use this command either with an
.IR id ,
which is the identifying number assigned by the function that created the
memory item in question; or with a
.IR key ,
which is the identifier used by the application that requested the memory item.
.PP
.B ipcrm
recognizes the following options:
.IP "\fBm \fIid\fR"
Remove the shared-memory segment with an identifier of
.IR id .
.IP "\fBq \fIid\fR"
Remove the message queue with an identifier of
.IR id .
.IP "\fBs \fIid\fR"
Remove the semaphore set with an identifier of
.IR id .
.IP "\fBM \fIkey\fR"
Remove the shared-memory segment with a key of
.IR key .
.IP "\fBQ \fIkey\fR"
Remove the message queue with a key of
.IR key .
.IP "\fBS \fIkey\fR"
Remove the semaphore set with a key of
.IR key .
.PP
To find the identifiers and keys for
for the IPC resources that are currently allocated, use the command
.BR ipcs .
.SH "See Also"
.Xr "commands," commands
.Xr "ipcs," ipcs
.Xr "msgget()," msgget
.Xr "semget()," semget
.Xr "shmget()" shmget
.SH Notes
.B ipcrm
does not remove
a shared-memory segment until all processes attached to it
are removed by calls to the function
.BR shmat() .
.PP
Any user can run
.BR ipcrm ;
however, a user can remove only those memory items that he ``owns'', as
noted in the control structure for the item.
The superuser
.B root
can, of course, remove all memory items, no questions asked.
