Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux commonly used View hardware configuration commands

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Check the total number of CPUs

1

The first method: top command method

First execute the top command, as shown below.

Linux How to check the total number of CPUs and total memory of a host

2

In the display interface of the top command, press the number key 1 to view the total number of CPUs in the current system, as shown in the figure below for the 4-core CPU.

Linux How to check the total number of CPUs and total memory of a host

3

The second method is to directly obtain the total number of CPUs through the proc file system, and specifically execute the following command:

cat /proc/cpuinfo | grep processor

Linux How to check the total number of CPUs and total memory of a host

END

Second, check the total memory method

1

The first method: top command method

top is a very powerful command, which can also be used to total memory, as shown in the following figure.

Linux How to check the total number of CPUs and total memory of a host

2

Second method: free command method

The free command is mainly used to display the amount of memory, as shown in the following figure

Linux How to check the total number of CPUs and total memory of a host

3

Generally use the free command-h parameter, more user-friendly display

Linux How to check the total number of CPUs and total memory of a host

4

The third method: through proc virtual file system, to directly obtain the total memory count.

head /proc/meminfo

Linux How to check the total number of CPUs and total memory of a host

Check system version number (centos/readhat): cat /etc/redhat-release

View kernel version information

[bes8@JQ-BZ-284 ~]$ uname -a

Linux JQ-BZ-284 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

resources

#### # free -m #View memory usage and swap area usage

df -h #View partition usage

du -sh #View the size of the specified directory

grep MemTotal /proc/meminfo #View Total Memory

#grep MemFree /proc/meminfo #View amount of free memory

uptime #View system uptime, number of users, load

cat /proc/loadavg #View system load

#Disk and Partition

mount |column -t #View attached partition status

fdisk -l #View all partitions

swapon -s #View all swap partitions

hdparm -i /dev/hda #View disk parameters (IDE devices only)

dmesg |grep IDE #View IDE device detection at startup

network

ifconfig #View properties of all network interfaces

iptables -L #View firewall settings

route -n #View routing table

netstat -lntp #View all listening ports

netstat -antp #View all established connections

netstat -s #View network statistics

process

ps -ef #View all processes

top Real-time display of progress status

user

w #View active users

id #View specified user information

last #View user logins

cut -d: -f1 /etc/passwd #View all users of the system

cut -d: -f1 /etc/group #View all groups in the system

crontab -l #View the current user's scheduled tasks

service

chkconfig --list #List all system services

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

program

rpm -qa #View all installed packages

Other common commands are organized as follows:

View motherboard serial number: dmidecode| grep -i 'serial number'

kuduz: service kudzu start ( or restart)

View CPU info: cat /proc/cpuinfo [dmesg| grep -i 'cpu'][dmidecode -t processor]

View memory info: cat /proc/meminfo [free -m][vmstat]

View board information: cat /proc/pci

View video/sound information: lspci| grep -i 'VGA'[dmesg | grep -i 'VGA']

View network card information: dmesg| grep -i 'eth'[cat /etc/sysconfig/hwconf | grep -i eth][lspci | grep -i 'eth']

View PCI information: lspci (more intuitive than cat /proc/pci)

View USB devices: cat /proc/bus/usb/devices

View keyboard and mouse: cat /proc/bus/input/devices

View system hard disk information and usage: fdisk & disk - l & df

View interrupt requests (IRQs) by device: cat /proc/interrupts

View system architecture: uname -a

View and boot the 32-bit or 64-bit kernel mode of the system: isalist -v [isainfo -v][isainfo -b]

View hardware information, including bios, cpu, memory and other information: dmidecode

Determine the current display refresh rate: /usr/sbin/ffbconfig -rev ?

View system configuration: /usr/platform/sun4u/sbin/prtdiag -v

View patches applied to the current system: showrev -p

Display current run level: who -rH

View current bind version information: nslookup -class=chaos -q=txt version.bind

View hardware information: dmesg| more

Display peripheral information, such as usb, network card information: lspci

View loaded drivers:

lsnod

lshw

View current processor type and speed (dominant frequency): psrinfo -v

Print the current OBP version number: prtconf -v

View hard disk physical information (vendor, RPM, Capacity): iostat -E

View disk geometry and partition information: prtvtoc /dev/rdsk/c0t0d0s

Show number of i-nodes used and unused:

df -F ufs -o i

isalist -v

For files in "/proc" you can browse their contents using the File View command, which contains system-specific information:

Host CPU information: Cpuinfo

Host DMA channel information: Dma

File system information: Filesystems

Host interrupt message: Interrupts

Host I/O port number information: Ioports

Host memory information: Meninfo

Linux memory version information: Version

Remarks: proc - process information pseudo-filesystem Process information masquerading as file system

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report