ipcs命令详解

栏目: 后端 · 发布时间: 5年前

内容简介:ipcs是Linux下显示进程间通信设施状态的工具。可以显示消息队列、共享内存和信号量的信息。对于程序员非常有用,普通的系统管理员一般用不到此指令。

ipcs是 Linux 下显示进程间通信设施状态的工具。可以显示消息队列、共享内存和信号量的信息。对于 程序员 非常有用,普通的系统管理员一般用不到此指令。

ipcs shows information on the inter-process communication facilities for which the calling process has read access.By default it shows information about all three resources: shared memory segments, message queues, and semaphore arrays.

Without options, information shall be written in short format for message queues, shared memory segments, and semaphore sets that are currently active in the system. Otherwise, the information that is displayed is controlled by the options specified.
-q : Write information about active message queues.
-m : Write information about active shared memory segments.
-s : Write information about active semaphore sets.
 -a, --all         all (default)
------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages    

root@52coder:~# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      

root@52coder:~# ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     

root@52coder:~#

-c : Write creator’s user name and group name;.

-p : Write process number information. (Process ID of the last process to send a message and process ID of the last process to receive a message on message queues, process ID of the creating process, and process ID of the last process to attach or detach on shared memory segments.)

-t : Write time information. (Time of the last control operation that changed the access permissions for all facilities, time of the last msgsnd() and msgrcv() operations on message queues, time of the last shmat() and shmdt() operations on shared memory, and time of the last semop() operation on semaphores.)
root@52coder:~# ipcs -c

------ Message Queues Creators/Owners --------
msqid      perms      cuid       cgid       uid        gid       

------ Shared Memory Segment Creators/Owners --------
shmid      perms      cuid       cgid       uid        gid       

------ Semaphore Arrays Creators/Owners --------
semid      perms      cuid       cgid       uid        gid       

root@52coder:~# 
root@52coder:~# 
root@52coder:~# 
root@52coder:~# ipcs -p

------ Message Queues PIDs --------
msqid      owner      lspid      lrpid     

------ Shared Memory Creator/Last-op PIDs --------
shmid      owner      cpid       lpid      


root@52coder:~# ipcs -t

------ Message Queues Send/Recv/Change Times --------
msqid    owner      send                 recv                 change              

------ Shared Memory Attach/Detach/Change Times --------
shmid      owner      attached             detached             changed             

------ Semaphore Operation/Change Times --------
semid    owner      last-op                    last-changed              

root@52coder:~# 
root@52coder:~# ipcs --help

Usage:
 ipcs [resource-option...] [output-option]
 ipcs -m|-q|-s -i <id>

Show information on IPC facilities.

Options:
 -i, --id <id>  print details on resource identified by <id>
 -h, --help     display this help
 -V, --version  display version

Resource options:
 -m, --shmems      shared memory segments
 -q, --queues      message queues
 -s, --semaphores  semaphores
 -a, --all         all (default)

Output options:
 -t, --time        show attach, detach and change times
 -p, --pid         show PIDs of creator and last operator
 -c, --creator     show creator and owner
 -l, --limits      show resource limits
 -u, --summary     show status summary
     --human       show sizes in human-readable format
 -b, --bytes       show sizes in bytes

For more details see ipcs(1).

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

超级连接者:破解新互联时代的成功密码

超级连接者:破解新互联时代的成功密码

伊桑•祖克曼(ETHAN ZUCKERMAN) / 林玮、张晨 / 浙江人民出版社 / 2018-8-1 / CNY 72.90

● 我们生活在一个互联互通的世界,我们需要辩证地看待某些事件,发现隐藏在背后的真相。着眼当下,看清彼此之间的联系,而非凭空幻想未来世界联系之紧密。数字世界主义要求我们承担起责任,让隐藏的联系变成现实。 ● 我们对世界的看法是局限的、不完整的、带有偏见的。如果我们想要改变从这个广阔的世界所获取的信息,我们需要做出结构性的改变。 ● 建立联系是一种新的力量。无论是在国家层面、企业层面还是个......一起来看看 《超级连接者:破解新互联时代的成功密码》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试