Linux command series: netstat, tcpdump, ipcs, ipcrm, top, vmstat, uptime, iostat, free

I will not sort some commands, but just give some links, because these people write very comprehensively, just refer to them directly.

1.netstat

The netstat command can display all network connections (running ports, routing tables, socket connections, etc.)

The method of use is:

netstat [options]

The specific options are as follows (can be viewed through netstat -h):

-a (all)显示所有选项,默认不显示LISTEN相关
-t (tcp)仅显示tcp相关选项
-u (udp)仅显示udp相关选项
-n 拒绝显示别名,能显示数字的全部转化成数字。
-l 仅列出有在 Listen (监听) 的服務状态
-p 显示建立相关链接的程序名
-r 显示路由信息,路由表
-e 显示扩展信息,例如uid等
-s 按各个协议进行统计
-c 每隔一个固定时间,执行该netstat命令。

2.tcpdump

tcpdump is a network packet capture command, you can see the message data during the computer communication in detail.

For a detailed introduction about tcpdump, please refer to this article:

https://blog.csdn.net/lgh1117/article/details/80213397

3.ipcs

ipcs is used to report the status of inter-process communication facilities. The method of use is as follows:

ipcs -a  是默认的输出信息 打印出当前系统中所有的进程间通信方式的信息
ipcs -m  打印出使用共享内存进行进程间通信的信息
ipcs -q  打印出使用消息队列进行进程间通信的信息
ipcs -s  打印出使用信号进行进程间通信的信息

4.ipcrm

The memory identifier used to delete the message queue, semaphore, or shared memory.

-m SharedMemory id 删除共享内存标识 SharedMemoryID。与 SharedMemoryID 有关联的共享内存段以及数据结构都会在最后一次拆离操作后删除。
-M SharedMemoryKey 删除用关键字 SharedMemoryKey 创建的共享内存标识。与其相关的共享内存段和数据结构段都将在最后一次拆离操作后删除。
-q MessageID 删除消息队列标识 MessageID 和与其相关的消息队列和数据结构。
-Q MessageKey 删除由关键字 MessageKey 创建的消息队列标识和与其相关的消息队列和数据结构。
-s SemaphoreID 删除信号量标识 SemaphoreID 和与其相关的信号量集及数据结构。
-S SemaphoreKey 删除由关键字 SemaphoreKey 创建的信号标识和与其相关的信号量集和数据结构。

5.top

top is a performance analysis tool under linux, which can display the resource occupancy in each process in real time. Equivalent to the resource manager under windows.

For a detailed introduction to top, refer to the following article:

https://www.cnblogs.com/peida/archive/2012/12/24/2831353.html

6.vmstat

The vmstat command is used to display the status of virtual memory in Linux.

See below:

https://www.cnblogs.com/xqzt/p/5448983.html

7.uptime

Uptime is mainly used to obtain information such as system running time and Linux system load.

Uptime is easy to use, use uptime directly, there is an option -v to check the version.

I used uptime to print out the above information: 16:18:53 represents the current time, 7:06 represents the system running time, and the load average is the system average load in the last 1 minute, 5 minutes, and 15 minutes.

System average load: The average number of processes in the running queue per unit time.

8.iostat

iostat monitors the system's disk operations.

See below for details:

https://www.cnblogs.com/ftl1012/p/iostat.html

9.free

The free command can display the free and used physical memory and swap memory in the Linux system, as well as the buffer used by the kernel. Among the tools for Linux system monitoring, the free command is one of the most frequently used commands.

See the following article for details:

https://www.cnblogs.com/peida/archive/2012/12/25/2831814.html

 

Published 125 original articles · Like 24 · Visits 10,000+

Guess you like

Origin blog.csdn.net/qq_42214953/article/details/105464932