1IPCRM(1) User Commands IPCRM(1)
2
3
4
6 ipcrm - remove a message queue, semaphore set or shared memory id
7
9 ipcrm [options]
10 ipcrm {shm|msg|sem} id...
11
13 ipcrm removes System V interprocess communication (IPC) objects and
14 associated data structures from the system. In order to delete such
15 objects, you must be superuser, or the creator or owner of the object.
16
17 System V IPC objects are of three types: shared memory, message queues,
18 and semaphores. Deletion of a message queue or semaphore object is
19 immediate (regardless of whether any process still holds an IPC identi‐
20 fier for the object). A shared memory object is only removed after all
21 currently attached processes have detached (shmdt(2)) the object from
22 their virtual address space.
23
24 Two syntax styles are supported. The old Linux historical syntax spec‐
25 ifies a three letter keyword indicating which class of object is to be
26 deleted, followed by one or more IPC identifiers for objects of this
27 type.
28
29 The SUS-compliant syntax allows the specification of zero or more
30 objects of all three types in a single command line, with objects spec‐
31 ified either by key or by identifier. (See below.) Both keys and iden‐
32 tifiers may be specified in decimal, hexadecimal (specified with an
33 initial '0x' or '0X'), or octal (specified with an initial '0').
34
36 -M, --shmem-key shmkey
37 removes the shared memorysegment created with shmkey after the
38 last detach is performed.
39
40 -m, --shmem-id shmid
41 removes the shared memory segment identified by shmid after the
42 last detach is performed.
43
44 -Q, --queue-key msgkey
45 removes the message queue created with msgkey.
46
47 -q, --queue-id msgid
48 removes the message queue identified by msgid.
49
50 -S, --semaphore-key semkey
51 removes the semaphore created with semkey.
52
53 -s, --semaphore-id semid
54 removes the semaphore identified by semid.
55
56 -a, --all [shm msg sem]
57 Remove all resources. When option argument is provided the
58 removal is performed only to for the specified resource types.
59 Warning! Do not use -a if you are unsure how the software using
60 resources might react on missing objects. Some programs create
61 these resources at start up and may not have any code to deal
62 unexpected disappearance.
63
64 The details of the removes are described in msgctl(2), shmctl(2), and
65 semctl(2). The identifiers and keys may be found by using ipcs(1).
66
68 In its first Linux implementation, ipcrm used the deprecated syntax
69 shown in the SYNOPSIS. Functionality present in other *nix implementa‐
70 tions of ipcrm has since been added, namely the ability to delete
71 resources by key (not just identifier), and to respect the same com‐
72 mand-line syntax. For backward compatibility the previous syntax is
73 still supported.
74
76 ipcs(1), ipcmk(1), msgctl(2), msgget(2), semctl(2), semget(2),
77 shmctl(2), shmdt(2), shmget(2), ftok(3)
78
80 The ipcrm command is part of the util-linux package and is available
81 from Linux Kernel Archive ⟨ftp://ftp.kernel.org/pub/linux/utils/util-
82 linux/⟩.
83
84
85
86util-linux September 2011 IPCRM(1)