Linux system to view CPU machine model memory and other information

  • 2021-01-14 07:40:28
  • OfStack

At any time during system maintenance, it may be necessary to review CPU utilization and analyze system health based on the corresponding information. In linux, you can check CPU usage by using the top command. For a detailed explanation of the top command, see the detailed analysis of linux system performance using the top command.

top command is a commonly used performance analysis tool under Linux, which can display the resource occupation status of each process in the system in real time, similar to the task manager of Windows; However, here we mainly introduce 1 linux system to view CPU information, machine model, memory information, etc.

system


# uname -a        #  Check the kernel / The operating system /CPU information 
# head -n 1 /etc/issue  #  Check the operating system version 
# cat /proc/cpuinfo   #  To view CPU information 
# hostname        #  View computer name 
# lspci -tv       #  List all PCI equipment 
# lsusb -tv       #  List all USB equipment 
# lsmod         #  Lists the loaded kernel modules 
# env          #  View environment variables 

resources


# free -m        #  Look at the memory usage and swap usage 
# df -h         #  View the usage of each partition 
# du -sh < Directory name >    #  View the size of the specified directory 
# grep MemTotal /proc/meminfo  #  View total memory 
# grep MemFree /proc/meminfo  #  View the amount of free memory 
# uptime         #  Check the system running time, number of users, load 
# cat /proc/loadavg   #  View the system load 

Disks and partitions


# mount | column -t   #  View the state of the mounted partition 
# fdisk -l        #  View all partitions 
# swapon -s       #  View all swap partitions 
# hdparm -i /dev/hda   #  View disk parameters ( Applies only to IDE equipment )
# dmesg | grep IDE    #  View startup time IDE Equipment testing status 

network


# ifconfig        #  View the properties of all the network interfaces 
# iptables -L      #  View firewall Settings 
# route -n        #  View the routing table 
# netstat -lntp     #  View all listening ports 
# netstat -antp     #  View all connections that have been established 
# netstat -s       #  View network statistics 

process


# ps -ef         #  View all processes 
# top          #  Display process status in real time 

The user


# w           #  View active users 
# id < The user name >      #  View the specified user information 
# last          #  View the user login log 
# cut -d: -f1 /etc/passwd  #  View all users of the system 
# cut -d: -f1 /etc/group  #  View all groups on the system 
# crontab -l       #  View the current user's scheduled tasks 

service


# chkconfig --list    #  List all system services 
# chkconfig --list | grep on  #  List all started system services 

The program


# rpm -qa        #  View all installed packages 

View CPU information (model number)


# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 
   8 Intel(R) Xeon(R) CPU      E5410  @ 2.33GHz 
( See there are 8 A logical CPU,  Also know the CPU model ) 

# cat /proc/cpuinfo | grep physical | uniq -c 
   4 physical id   : 0 
   4 physical id   : 1 
( It means there are actually two 4 The nuclear CPU) 

# getconf LONG_BIT 
  32 
( Show the current CPU Running on the 32bit mode ,  But do not represent CPU Does not support 64bit) 

# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l 
  8 
( The result is greater than the 0,  That support 64bit To calculate . lm Refers to the long mode,  support lm It is 64bit) 

See cpu in full detail, but for the most part we don't care.


# dmidecode | grep 'Processor Information' 

View memory information


# free -m        #  Look at the memory usage and swap usage 
# df -h         #  View the usage of each partition 
# du -sh < Directory name >    #  View the size of the specified directory 
# grep MemTotal /proc/meminfo  #  View total memory 
# grep MemFree /proc/meminfo  #  View the amount of free memory 
# uptime         #  Check the system running time, number of users, load 
# cat /proc/loadavg   #  View the system load 
0

View machine model


# free -m        #  Look at the memory usage and swap usage 
# df -h         #  View the usage of each partition 
# du -sh < Directory name >    #  View the size of the specified directory 
# grep MemTotal /proc/meminfo  #  View total memory 
# grep MemFree /proc/meminfo  #  View the amount of free memory 
# uptime         #  Check the system running time, number of users, load 
# cat /proc/loadavg   #  View the system load 
1

View network card information


# free -m        #  Look at the memory usage and swap usage 
# df -h         #  View the usage of each partition 
# du -sh < Directory name >    #  View the size of the specified directory 
# grep MemTotal /proc/meminfo  #  View total memory 
# grep MemFree /proc/meminfo  #  View the amount of free memory 
# uptime         #  Check the system running time, number of users, load 
# cat /proc/loadavg   #  View the system load 
2

conclusion


Related articles: