Linux domestic operating system, UCA-system engineer learning necessary skills, system status query and process management, uname command last command top command and ps command kill command

 

Table of contents

​edit

1. System status query

1. 1.uname command

1.2. last command

 1.3. top command

2. Process management

2.1. ps command

2.2. kill command


1. System status query

1. 1.uname command

root@uos~#: uname
root@uos~#: uname -r

  

4.19 is the kernel, 0-6-amd64 is the architecture.

root@uos~#: uname -a

 

 The name of the eagle operating system, including the time, can be displayed.

root@uos~#: cat /proc/cpuinfo

Also view CPU information

 

 

root@uos~#: cat /proc/meminfo

This is to check the memory, but there is also a simpler free command

 

root@uos~#: free

 

 Mem refers to the physical memory; Swap refers to the swap partition, which is equivalent to drawing out a piece on the hard disk. When the physical memory is not enough, this partition memory will be called here, but it is best not to use it. Cause computer performance to be damaged, unless the physical memory is too small.

1.2. last command

root@uos~#: last
root@uos~#: lastlog

The last command is used to check the login status of the system

 

lastlog is used to check all users

 

 1.3. top command

root@uos~#: top

 

The display under the top command shows that it is being recorded in real time.

 

 Load average performance load, within one minute, within five minutes and within fifteen minutes of the load.

182 total means that there are 182 processes, 1 running means that one is running, 181 sleeping means that 181 are sleeping and not participating in the process, stopped means stopped, and zombie means zombie (it used to be a normal process, but something went wrong later, it is not normal death, harmful to the program). If the process is killed, it will disappear from the total.

root@uos~#: pstree

 

 Tree diagram of system processes

root@uos~#: dd if=/dev/zero of=/dev/null bs=1M count=100000000

dd is a command, if is an input file, and of is an output file, which means to dig a part from a zero device and place it in null.

Zero means 0, and null means nothing (equivalent to a black hole). count represents how many times, bs represents how much to write at a time.

2. Process management

2.1. ps command

root@uos~#: ps

 

 ps is the command for process management view.

root@uos~#: ps aux

This command lists all process parameters. a means to list all processes, u means to arrange in order of users, and x means to list all the values.

 

 root@uos~#: ps aux | grep ping

General process management will combine ps and grep, so that you can accurately find the process status and content you want to check. S+ means running status.

2.2. kill command

root@uos~#: kill -l

 

 The kill command is not simply used to kill the process, SIGKILL (single process kill command) is the meaning of killing, the kill command is a status command,

The numbers above represent commands

root@uos~#: kill -19 4810

-19 means the command in the kill state, 4810 is the process, and SIGSTOP stops the 4010 process. T means stop.

After this operation, you can use top to check it, and you will find that there is a 1 stopped, indicating that one of the processes has stopped.

9) The difference between SIGKILL and 15) SIGTERM: 9 means kill, 165 means termination, 9 just ends the process directly, and 15 kills the process after considering all the circumstances. SIFTERM is more humane. So it is generally recommended to use 15)

 

Guess you like

Origin blog.csdn.net/Williamtym/article/details/131341711