How to view cpu, memory, hard disk, and other hardware information in linux

Source: Internet
Author: User
Tags dmesg

How to view cpu, memory, hard disk, and other hardware information in linux

Note: in Linux, you can view detailed information about each cpu in/proc/cpuinfo. However, for dual-core CPUs, two CPUs are displayed in cpuinfo. It is often mistaken for two single-core CPUs.

Address: http://www.hpboys.com/659.html

I. linux CPU size

  1. [Root @ idc ~] # Cat/proc/cpuinfo | grep "model name" & cat/proc/cpuinfo | grep "physical id"
  2. Model name: Intel (R) Xeon (TM) CPU 2.80 GHz
  3. Model name: Intel (R) Xeon (TM) CPU 2.80 GHz
  4. Model name: Intel (R) Xeon (TM) CPU 2.80 GHz
  5. Model name: Intel (R) Xeon (TM) CPU 2.80 GHz
  6. Physical id: 0
  7. Physical id: 0
  8. Physical id: 3
  9. Physical id: 3
  10. [Root @ idc ~] #

In fact, Physical Processor ID should be used to distinguish between single-core and dual-core. Physical Processor ID can be found from cpuinfo or dmesg. flags if ht indicates that the number of physical CPUs can be determined by hyperthreading technology. The value of Physical id can be viewed.

As you can see, this machine has two dual-core CPUs with IDs 0 and 3, respectively, and the size is 2.8 GB.


Ii. Memory size

  1. [Root @ xbidc ~] # Cat/proc/meminfo | grep MemTotal
  2. MemTotal: 1034612 kB
  3. [Root @ xbidc ~] #


Iii. Hard Disk size

  1. [Root @ xbidc ~] # Fdisk-l | grep Disk
  2. Disk/dev/sda: 300.0 GB, 300000000000 bytes
  3. [Root @ xbidc ~] #


4. More methods to view linux hardware information

  1. Uname-a # linux system information command for viewing kernel/operating system/CPU Information
  2. Head-n 1/etc/issue # view the operating system version, which is a number 1, not a letter L
  3. Cat/proc/cpuinfo # linux system information command for viewing CPU Information
  4. Hostname # linux system information command for viewing computer names
  5. Lspci-TV # list all PCI devices
  6. Lsusb-TV # linux system information commands for listing all USB devices
  7. Lsmod # list loaded Kernel Modules
  8. Env # view environment variable resources
  9. Free-m # view memory usage and swap zone usage
  10. Df-h # view the usage of each partition
  11. Du-sh # view the size of the specified directory
  12. Grep MemTotal/proc/meminfo # view total memory
  13. Grep MemFree/proc/meminfo # view the Amount of idle memory
  14. Uptime # view system running time, number of users, and load
  15. Cat/proc/loadavg # view system load disks and partitions
  16. Mount | column-t # view the status of the mounted Partition
  17. Fdisk-l # view all partitions
  18. Swapon-s # view all swap partitions
  19. Hdparm-I/dev/hda # view disk parameters (only applicable to IDE devices)
  20. Dmesg | grep IDE # view the network of IDE Device Detection Status at startup
  21. Ifconfig # view the attributes of all network interfaces
  22. Iptables-L # view firewall settings
  23. Route-n # view the route table
  24. Netstat-lntp # view all listening ports
  25. Netstat-antp # view all established connections
  26. Netstat-s # view network statistics process
  27. Ps-ef # view all processes
  28. Top # real-time display of Process status users
  29. W # view active users
  30. Id # view specified user information
  31. Last # view User Logon logs
  32. Cut-d:-f1/etc/passwd # view all users in the system
  33. Cut-d:-f1/etc/group # view all groups in the system
  34. Crontab-l # view the scheduled Task Service of the current user
  35. Chkconfig-list # list all system services
  36. Chkconfig-list | grep on # list all started system service programs
  37. Rpm-qa # view all installed software packages
  38. Cat/proc/cpuinfo: linux system command for viewing CPU-related parameters
  39. Cat/proc/partitions: Command Used to view linux hard disk and partition information
  40. Cat/proc/meminfo: linux system command for viewing linux system memory information
  41. Cat/proc/version: view the version, similar to uname-r
  42. Cat/proc/ioports: view the device's io port
  43. Cat/proc/interrupts: view the interrupt
  44. Cat/proc/pci: View pci device information
  45. Cat/proc/swaps: View information about all swap partitions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.