ipcs:
-q Writes information about active message queues
-o
Writes the following usage information:
* Number of messages on queue
* Total number of bytes in messages in queue for message queues
* Number of processes attached to shared memory segments
-m
Writes information about active shared memory segments.
secumid$ ipcs -qo | grep secumid
q 123731977 0x4207803a --rw-rw-rw- secumid staff 0 0
q 104857729 0x4107803a -Rrw-rw-rw- secumid staff 0 0
secumid$ ipcs -m | grep secumid
m 16777365 0x4707803d --rw------- secumid staff
-------------------------------------------------------------------------------------------------------------------------
secumid$ ipcs | grep secumid | awk '{printf("ipcrm -%s %s;\n", $1, $2)}'