The use of ipcs command in Linux system

Learning of ipcs command

Inter-process communication and more commonly used techniques include 共享内存, 消息队列, 信号量and so on.
ipcsThe purpose of the command is mainly used to report the status of the inter-process communication facility.

①View help: ipcs -help
Insert picture description here

②View all resources (facilities): ipcs -aoripcs
Insert picture description here

③The three types of resources are viewed separately:
View Message Queue ipcs -q
Insert picture description here
separately ipcs -m: View Shared Memory Segments separately :
Insert picture description here
View Semaphore Arrays separately:ipcs -s
Insert picture description here

④ resource options and output options can be 搭配used to -cdisplay the creator and owner of an example: ipcs -cand ipcs -s -c
options -t, -p, -l, -u, -bempathy.
Insert picture description here

⑤ options -iused by semidor shmidfor more information print resources: ipcs -s -i 9,ipcs -m -i 9
Insert picture description here
Insert picture description here

⑥Column description:

Shared memory is the key;
shmidis the number of shared memory;
semidis the number of semaphore arrays;
nsemscorresponding to the semaphore semaphore number of focus
pidis the process ip, can ps -ef | grep pidview details
semnumsemaphore number
ncountis the number of processes waiting for this signal
拥有者is to create Its user (owner);
权限that is, perms;
字节is the size bytes created;
连接数nattach
状态is the number of processes connected to the shared memory; is the status of the shared memory.

Expand

Show what are contained in the ipcs semaphore set进程
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_39599464/article/details/114969788