ipcrm - remove a message queue, semaphore set, or shared memory segment identifier ipcrm [ -q msgid | -Q msgkey | -s semid | -S semkey | -m shmid | -M shmkey ] ... removes message queues, semaphore sets, or shared memory segments.

-q msgID
-Q msgKey
Remove the message queue its data.
-Q msgkey Remove the message queue and destroy its data
-m shmid
-M shmkey Remove the shared memory identifier, The shared memory segment and its data are destroyed after the last detach.
-S semkey
-d semid
Remove semaphore and its data.