命令在linux中检查消息队列和共享内存的状态?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18786466/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 00:49:59  来源:igfitidea点击:

command to check status of message queue and shared memory in linux?

linuxipcmessage-queueshared-memory

提问by zishan

Sorry to ask such a silly question as i am noob in unix. what are the unix commands to find shared memory and message queue and how to kill them ?

很抱歉问这样一个愚蠢的问题,因为我是 unix 的菜鸟。查找共享内存和消息队列的 unix 命令是什么以及如何杀死它们?

采纳答案by HAL

ipcs(1)provides information on the IPC facilities and ipcrm(1)can be used to remove the IPC objects from the system.

ipcs(1)提供有关 IPC 设施的信息,ipcrm(1)可用于从系统中删除 IPC 对象。

List shared memory segments:

列出共享内存段:

ipcs -m

List message queues:

列出消息队列:

ipcs -q

Remove shared memory segment created with shmkey:

删除使用shmkey以下方法创建的共享内存段:

ipcrm -M key

Remove shared memory segment identified by shmid:

删除由shmid以下标识的共享内存段:

ipcrm -m id

Remove message queue created with msgkey:

删除使用msgkey以下方法创建的消息队列:

ipcrm -Q key

Remove message queue identified by msgid:

删除由 标识的消息队列msgid

ipcrm -q id