找到了ipcs和ipcrm
http://www.tldp.org/LDP/lpg/node22.htmlThe ipcs Command
The ipcs command can be used to obtain the status of all System V IPC objects. The Linux version of this tool was also authored by Krishna Balasubramanian.
ipcs -q: Show only message queues
ipcs -s: Show only semaphores
ipcs -m: Show only shared memory
ipcs --help: Additional arguments
By default, all three categories of objects are shown. Consider the following sample output of ipcs:
------ Shared Memory Segments --------
shmid owner perms bytes nattch status
------ Semaphore Arrays --------
semid owner perms nsems status
------ Message Queues --------
msqid owner perms used-bytes messages
0 root 660 5 1
Here we see a single message queue which has an identifier of ``0''. It is owned by the user root, and has octal permissions of 660, or -rw-rw--. There is one message in the queue, and that message has a total size of 5 bytes.
The ipcs command is a very powerful tool which provides a peek into the kernel's storage mechanisms for IPC objects. Learn it, use it, revere it.
The ipcrm Command
The ipcrm command can be used to remove an IPC object from the kernel. While IPC objects can be removed via system calls in user code (we'll see how in a moment), the need often arises, especially under development environments, to remove IPC objects manually. Its usage is simple:
ipcrm <msg | sem | shm> <IPC ID>
Simply specify whether the object to be deleted is a message queue (msg), a semaphore set (sem), or a shared memory segment (shm). The IPC ID can be obtained by the ipcs command. You have to specify the type of object, since identifiers are unique among the same type (recall our discussion of this earlier).