Linux commands-monitoring and linux Command monitoring
1. netstat
Displays network-related information, such as network connection, route table, Interface Statistics, masquerade connection, and Multicast member (Multicast Memberships.
Common parameters:
- -A (all) shows all options. LISTEN is not displayed by default.
- -T (tcp) only displays tcp-related options
- -U (udp) only displays udp-related options
- -N: aliases are not displayed. All digits can be converted to digits.
- -L only lists the service statuses that have been listened to by Listen.
- -P: the program name for establishing the relevant link
- -R: displays route information and route tables.
- -E: Display extension information, such as uid.
- -S: statistics by Protocol
- -C runs the netstat command at every fixed time.
2. tcpdump
A packet analysis tool that intercepts packets on the network according to the user's definition. Tcpdump can completely intercept the "Header" of the packets transmitted in the network for analysis. It supports filtering network layer, protocol, host, network or port, and provides logical statements such as and, or, not to help you remove useless information.
3. ipcs
Write some information about the communication facilities between active processes to the standard output.
Common parameters:
- -A is the default output that prints information about all inter-process communication modes in the current system.
- -M prints out the information for inter-process communication using the shared memory.
- -Q: the message queue is used for inter-process communication.
- -S prints the information that uses signals for inter-process communication.
4. ipcrm
Deletes a message queue, signal set, or shared memory ID. Only the super administrator or the creator of the ipc object has this permission.
Common parameters:
- -M shmkey: remove the shared memory segment created with shmkey
- -M shmid: Remove shared memory segments identified by shmid
- -Q msgkey: remove the Message Queue created with msqkey
- -Q msqid: remove the Message Queue identified by msqid
- -S semkey: Remove signals created with semkey
- -S semid remove signals identified by semid
5. uptime
The following information is displayed in sequence: current time, how long the system has been running, how many login users are there, and the average load of the system in the past 1 minute, 5 minutes, and 15 minutes.
6. free
View the memory size in the system.
7. top
The system performance can be viewed dynamically in real time, and resources used by CPU and memory as well as information about related processes can be analyzed.
8. ps
The ps command is used to list the processes currently running in the system. The ps command lists the snapshots of the current processes, that is, those processes that run the ps command at that time. If you want to dynamically display process information, you can use the top command.