Home > Article > System Tutorial > Find Total CPU and Total Memory Usage of Linux System
Today we will introduce the Linux system. Next we will take a look at Linux. To check the total number of CPUs and total memory of the host, you can refer to the following method.
1. Check the total number of cpu
The first method: top command method
First execute the top command, as shown in the figure below.
In the display interface of the top command, press the numeric key 1, to view the total number of CPUs in the current system, as shown below for a 4-core CPU.
Method 2: Get the total number of CPUs directly through the proc file system. Specifically execute the following command:
cat /proc/cpuinfo | grep processor
2. How to check the total memory
Method 1: top command method
top is a very powerful command. You can also use it to total memory, as shown in the figure below.
Method 2: free command method
The free command is mainly used to display the amount of memory, as shown in the figure below
Generally use the -h parameter of the free command for a more user-friendly display
Method 3: Get the total memory directly through the proc virtual file system.
head /proc/meminfo
This is the method that the editor currently knows about checking the total number of CPUs and total memory of the host in Linux. If new methods are found in the future, we will continue to add them.
related suggestion:
How to configure dual graphics cards in Linux system?
How to check cpu information in Linux system?
How to use commands to view the contents of a specified number of lines in a file in Linux?
The above is the detailed content of Find Total CPU and Total Memory Usage of Linux System. For more information, please follow other related articles on the PHP Chinese website!