Linux example of how to view hardware configuration commands
Hardware View Command
System
# uname-a # View kernel / operating system / CPU information # head-n 1 / etc/issue # View operating system version # cat / proc/cpuinfo # View CPU information # cat / proc/version # View operating system details # hostname # View computer name # lspci-tv # list all PCI devices # lsusb-tv # list all USB settings # lsmod # list loaded kernel modules # env # View environment variables
Resources
# free-m # View memory usage and switch area usage # df-h # View partition usage # du-sh # View the size of a specified directory # grep MemTotal / proc/meminfo # View Total memory # grep MemFree / proc/meminfo # View Free memory # uptime # View system Runtime, number of users, load # cat / proc/loadavg # View system load
Disks and partitions
# mount | column-t # View the status of mounted partitions # fdisk-l # View all partitions # swapon-s # View all swap partitions # hdparm-I / dev/hda # View disk parameters (for IDE devices only) # dmesg | grep IDE # View the detection status of IDE devices at startup
The 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 # display process status in real time
User
# w # View active users # id # View specified user information # last # View user login log # cut-d:-F1 / etc/passwd # View all users of the system # cut-d:-F1 / etc/group # View all groups of 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
program
# rpm-qa # View all installed packages
Other common commands are sorted out as follows:
Check the serial number of the motherboard: dmidecode | grep-I 'serial number'
Use the hardware detector kuduz to detect new hardware: service kudzu start (or restart)
View CPU information: cat / proc/cpuinfo [dmesg | grep-I 'cpu'] [dmidecode-t processor]
View memory information: cat / proc/meminfo [free-m] [vmstat]
View board information: cat / proc/pci
View video / sound card information: lspci | grep-I 'VGA' [dmesg | grep-I' VGA']
View Nic 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
Check the hard disk information and usage of the system: fdisk & disk-l & df
View interrupt requests (IRQ) for each device: cat / proc/interrupts
View the 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, etc.: dmidecode
Determine the current display refresh rate: / usr/sbin/ffbconfig-rev?
View system configuration: / usr/platform/sun4u/sbin/prtdiag-v
Check out the patches that have been applied on the current system: showrev-p
Displays the current run level: who-rH
View the current bind version information: nslookup-class=chaos-q=txt version.bind
View hardware information: dmesg | more
Display peripheral information, such as usb, network card, etc.: lspci
View the loaded drivers:
Lsnod
Lshw
View the type and speed of the current processor (main frequency): psrinfo-v
Print the current OBP version number: prtconf-v
View hard disk physical information (vendor, RPM, Capacity): iostat-E
View the geometric parameters and partition information of the disk: prtvtoc / dev/rdsk/c0t0d0s
Displays the number of i-node used and unused:
Df-F ufs-o I
Isalist-v
Files in "/ proc" can be browsed using the file view command, which contains system-specific information:
Host CPU information: Cpuinfo
Host DMA tunnel information: Dma
File system information: Filesystems
Host interrupt information: Interrupts
Host Imap O port number information: Ioprots
Host memory information: Meninfo
Linux memory version information: Version
Note: proc-process information pseudo-filesystem process information camouflage file system
Cat / proc/cpuinfo analysis output
# Total number of cores = number of physical CPU X number of cores per physical CPU # total number of logical CPU = number of physical CPU X number of cores per physical CPU X number of hyperthreads # View the number of physical CPU cat / proc/cpuinfo | grep "physical id" | sort | uniq | wc-l # View the number of core in each physical CPU (that is, the number of cores) cat / proc/cpuinfo | grep "cpu cores" | uniq# view the number of logical CPU cat / proc/cpuinfo | grep "processor" | wc-lmuri-= processor: the number of the logical processing core in the system. For a single-core processor, the lesson considers it to be its CPU number For multi-core processors, it can be a physical core or a virtual logical core using hyperthreading technology: CPU manufacturer cpu family: CPU product family code model: CPU belongs to which generation of the code model name: CPU belongs to and its number, Nominal main frequency stepping: CPU belongs to the actual use of the updated version cpu MHz: CPU cache size: CPU secondary cache size physical id: single CPU label siblings: single CPU logical physical core core id: the current physical core number in the CPU where it is located This number is not necessarily continuous cpu cores: the number of physical cores of the CPU where the logical core is located apicid: the number used to distinguish different logical cores, the number of each logical core in the system must be different, this number is not necessarily continuous fpu: whether there is a floating point operation unit (Floating Point Unit) fpu_exception: whether floating point calculation exception cpuid level is supported: the value in the eax register before executing the cpuid instruction Depending on the value, the cpuid instruction returns different content wp: indicates whether the current CPU kernel supports write protection of user space (Write Protection) flags: function supported by the current CPU bogomips: roughly estimated CPU speed (Million Instructions Per Second) clflush size: cache size unit per refresh cache_alignment: cache address alignment unit address sizes: number of bits in the accessible address space
Cat / proc/meminfo
$cat / proc/meminfoMemTotal: 2052440 kB / / Total memory MemFree: 50004 kB / / Free memory Buffers: 19976 kB / / buffer size for files Cached: 436412 kB / / cache (size used by http://baike.baidu.com/view/496990.htm): SwapCached: 19864 kB / / size of swap space used by cache Active: 1144512 kB / / in active use Cache page file size Inactive: 732788 kB / / infrequently used cache page file size Active (anon): 987640 kB / / anon: soon Inactive (anon): 572512 kBActive (file): 156872 kBInactive (file): 160276 kBUnevictable: 8 kBMlocked: 8 kBHighTotal: 1177160 kB / / The total and free amount of memory In kilobytes, that is not directly mapped into kernel space.HighFree: 7396 kB / / The HighTotal value can vary based on the type of kernel used.LowTotal: 875280 kB / / The total and free amount of memory, in kilobytes, that is directly mapped into kernel space. Used.LowFree: 42608 kB / / The LowTotal value can vary based on the type of kernelSwapTotal: 489940 kB / / Total size of swap space SwapFree: 450328 kB / / Free swap space Dirty: 450328 kB / / size waiting to be written back to disk Writeback: 0 kB / / size being written back AnonPages: 1408256 kB / / size of unmapped pages Mapped: 131964 kB / / device and file mapping Size of Slab: 37368 kB / / size of kernel data structure cache Reduce the consumption of requested and released memory SReclaimable: 14164 kB / / size of recoverable slab SUnreclaim: 23204 kB / / size of irrecoverable slab 23204+14164=37368PageTables: 13308 kB / / size of index table for managing memory paging NFS_Unstable: 0 kB / / size of unstable page table Bounce: 0 kB / / bounce: return WritebackTmp: 0 kB / / CommitLimit: 1516160 kBCommitted_AS: 2511900 kBVmallocTotal: 122880 kB / / Virtual memory size VmallocUsed: 28688 kB / / Virtual memory size already used VmallocChunk: 92204 kBHugePages_Total: 0 / / allocation of large pages HugePages_Free: 0HugePages_Rsvd: 0HugePages_Surp: 0Hugepagesize: 2048 kBDirectMap4k: 10232 kBDirectMap2M: 899072 kB
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.