The “ipcrm” command is a command-line utility that is used to delete various types of IPC (Inter-process Communication) resources. These resources include shared memory, message queues, and semaphores.
It’s also important to note that “ipcrm” command is used to delete the IPC resources that were created using “ipcmk” command or similar IPC creation commands.
ipcrm Command Examples
1. Delete a shared memory segment by ID:
# ipcrm --shmem-id shmem_id
2. Delete a shared memory segment by key:
# ipcrm --shmem-key shmem_key
3. Delete an IPC queue by ID:
# ipcrm --queue-id ipc_queue_id
4. Delete an IPC queue by key:
# ipcrm --queue-key ipc_queue_key
5. Delete a semaphore by ID:
# ipcrm --semaphore-id semaphore_id
6. Delete a semaphore by key:
# ipcrm --semaphore-key semaphore_key
7. Delete all IPC resources:
# ipcrm --all