ipcrm(1)

ipcrm1

Remove the specified message queues, semaphore sets, and shared segments

Usage

ipcrm [-W] [-v] [-q msqid] [-m shmid] [-s semid] [-Q msgkey] [-M shmkey] [-S semkey] ...

Overview

The ipcrm utility removes the specified message queues, semaphores and shared memory segments. These System V IPC objects can be specified by their creation ID or any associated key.

The following options are generic:

-v

If specified once with -W or with -1 for an object, it will show all removed objects. If specified twice with -W or with -1 for an objects, it will show all removed objects and all failed removals.

-W

Try to wipe all specified message queues, semaphores and shared memory segments.

-y

Use the kvm(3) interface instead of the sysctl(3) interface to extract the required information. If ipcrm is to operate on the running system, using kvm(3) will require read privileges to /dev/kmem.

The following options are used to specify which IPC objects will be removed. Any number and combination of these options can be used:

-q msqid

Remove the message queue associated with the ID msqid from the system.

-m shmid

Mark the shared memory segment associated with ID shmid for removal. This marked segment will be destroyed after the last detach.

-s semid

Remove the semaphore set associated with ID semid from the system.

-Q msgkey

Remove the message queue associated with key msgkey from the system.

-M shmkey

Mark the shared memory segment associated with key shmkey for removal. This marked segment will be destroyed after the last detach.

-S semkey

Remove the semaphore set associated with key semkey from the system.

The identifiers and keys associated with these System V IPC objects can be determined by using ipcs(1). If the identifier or the key is -1, it will remove all these objects.

Releases

87 releases since FreeBSD 2.0.5-RELEASE; the text changed 48 times.

  1. 2.0.5
  2. 2.1.5–2.2.2
  3. 2.2.5–2.2.8
  4. 2.2.9
  5. 3.0–3.2
  6. 3.3–3.4
  7. 3.5–3.5.1
  8. 4.0
  9. 4.1–4.2
  10. 4.3
  11. 4.4–4.6.2
  12. 4.7
  13. 4.8–4.11
  14. 5.0
  15. 5.1–5.2.1
  16. 5.3–6.3
  17. 6.4
  18. 7.0
  19. 7.1
  20. 7.2
  21. 7.3
  22. 7.4
  23. 8.0
  24. 8.1
  25. 8.2
  26. 8.3
  27. 8.4
  28. 9.0
  29. 9.1
  30. 9.2
  31. 9.3
  32. 10.0
  33. 10.1
  34. 10.2
  35. 10.3
  36. 10.4
  37. 11.0
  38. 11.1
  39. 11.2
  40. 11.3
  41. 11.4
  42. 12.0
  43. 12.1
  44. 12.2
  45. 12.3
  46. 12.4
  47. 13.0–13.2
  48. 13.3–15.1
  49. 16.0

-W since FreeBSD 7.1-RELEASE; -v since FreeBSD 7.1-RELEASE; -y since FreeBSD 7.1-RELEASE.

History

The wiping of all System V IPC objects was first implemented in FreeBSD 6.4 and FreeBSD 7.1.

Authors

The original author was Adam Glass. The wiping of all System V IPC objects was thought up by Callum Gibson and extended and implemented by Edwin Groothuis.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.