1. Command Introduction The ipcs command is used to report the status of inter-process communication facilities in Linux. The displayed information includes message lists, shared memory, and semaphore information. It can help developers locate problems in inter-process communication. 2. Command format ipcs [resource-option] [output-format] ipcs [resource-option] -i id 3. Command Options -i, --id [id]: Display detailed IPC information of the specified resource ID. You need to specify the resource type when using it. Resources include message queues (-q), shared memory (-m), and semaphores (-s). -h, --help: Display help information -V, --version: Display version information IPC resource type options: -q, --queues: Display active message queue information -m, --shmems: Display active shared memory information -s, --semaphores: Display active semaphore information -a, --all: Display all IPC information in the system. The default output format options for the command: When multiple options are specified, the last one takes precedence. -c, --creator: View the creator and owner of the IPC -l, --limits: View the limit information of the IPC resource -p, --pid: View the process ID of the creator and last operator of the IPC resource -t, --time: View the detailed time of the latest call to IPC resources. This includes operations on message queues using msgsnd() and msgrcv(), operations on shared memory using shmat() and shmdt(), and operations on semaphores using semop(). -u, --summary: View the IPC resource status summary information. Display size unit control options: Only effective for option -l (--limits). -b, --bytes: Display size in bytes --human: Display size in human readable format 4. Common Examples (1) Display all IPC information. [root@TENCENT64 /]# ipcs ------ Message Queues -------- key msqid owner perms used-bytes messages ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x6674431e 0 root 600 50485760 9 ------ Semaphore Arrays -------- key semid owner perms nsems 0x0000870a 0 root 666 1 (2) Display information about the specified shared memory ID. [root@TENCENT64 /]# ipcs -m -i 32769 Shared memory Segment shmid=32769 uid=0 gid=0 cuid=0 cgid=0 mode=0666 access_perms=0666 bytes=12000 lpid=2784 cpid=1077 nattch=3 att_time=Thu Dec 27 10:39:32 2018 det_time=Thu Dec 27 10:39:32 2018 change_time=Fri Jul 20 13:17:41 2018 (3) Check the process ID of the creator and the last operator of the IPC. ------ Message Queues PIDs -------- msqid owner lspid lrpid ------ Shared Memory Creator/Last-op PIDs -------- shmid owner cpid lpid 0 root 702 23364 32769 root 702 5296 Among them, lspid represents the "process number" of the last message sent to the message queue, and lrpid corresponds to the "process number" of the last message read from the message queue. But please note: the process number here is a weak process number, that is, it may represent the thread number. If the thread in the process sends and receives messages to the message queue, the pid here corresponds to the thread number. You can use ps -AL | grep pid to find the process id corresponding to the thread. The above is the detailed content of the use of Linux ipcs command. For more information about Linux ipcs command, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: Vue+element implements drop-down menu with local search function example
>>: Detailed analysis of MySQL optimization of like and = performance
1. Font properties color, specifies the color of ...
environment System: Ubuntu 18.04 Software: qt5.12...
MySQL variables include system variables and syst...
The cursor size in the input box is inconsistent T...
will-change tells the browser what changes will h...
In this article, I will show you how to install a...
In the previous article, I introduced the detaile...
This article introduces the sample code of CSS3 c...
Docker is a very popular container technology. Th...
This article example shares the specific code of ...
How to write judgment statements in mysql: Method...
Overview The cloud platform customer's server...
Simply use CSS to achieve all the effects of corn...
The final solution is in the last picture If you ...
This article shares with you the graphic tutorial...