美文网首页
Linux查看硬件信息

Linux查看硬件信息

作者: teitiyuu | 来源:发表于2017-08-24 13:56 被阅读0次

    查看CPU信息(型号)

    cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c(CPU基本信息)

    [root@myhome ~]$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 
          4  Intel(R) Xeon(R) CPU E5-2683 v4 @ 2.10GHz
    [root@myhome ~]$ 
    

    cat /proc/cpuinfo | grep physical | uniq -c (CPU内核)

    [root@myhome ~]$ cat /proc/cpuinfo | grep physical | uniq -c
          1 physical id : 0
          1 address sizes   : 46 bits physical, 48 bits virtual
          1 physical id : 0
          1 address sizes   : 46 bits physical, 48 bits virtual
          1 physical id : 0
          1 address sizes   : 46 bits physical, 48 bits virtual
          1 physical id : 0
          1 address sizes   : 46 bits physical, 48 bits virtual
    [root@myhome ~]$ 
    

    getconf LONG_BIT (CPU运行模式)

    [root@myhome ~]$ getconf LONG_BIT 
    64
    [root@myhome ~]$ 
    

    查看内存信息

    cat /proc/meminfo (内存基本信息)

    [root@myhome ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 
          4  Intel(R) Xeon(R) CPU E5-2683 v3 @ 2.00GHz
    [root@myhome ~]# cat /proc/meminfo
    MemTotal:       16004820 kB
    MemFree:          839276 kB
    MemAvailable:    3633748 kB
    Buffers:          136648 kB
    Cached:          3367712 kB
    SwapCached:        69688 kB
    Active:         11404256 kB
    Inactive:        3030368 kB
    Active(anon):   10581676 kB
    Inactive(anon):  1034380 kB
    Active(file):     822580 kB
    Inactive(file):  1995988 kB
    Unevictable:           0 kB
    Mlocked:               0 kB
    SwapTotal:       2096444 kB
    SwapFree:        1469268 kB
    Dirty:              1020 kB
    Writeback:             0 kB
    AnonPages:      10860624 kB
    Mapped:           589320 kB
    Shmem:            685792 kB
    Slab:             431444 kB
    SReclaimable:     310140 kB
    SUnreclaim:       121304 kB
    KernelStack:       92720 kB
    PageTables:        77920 kB
    NFS_Unstable:          0 kB
    Bounce:                0 kB
    WritebackTmp:          0 kB
    CommitLimit:    10098852 kB
    Committed_AS:   33813824 kB
    VmallocTotal:   34359738367 kB
    VmallocUsed:       38452 kB
    VmallocChunk:   34359638016 kB
    HardwareCorrupted:     0 kB
    AnonHugePages:   5373952 kB
    HugePages_Total:       0
    HugePages_Free:        0
    HugePages_Rsvd:        0
    HugePages_Surp:        0
    Hugepagesize:       2048 kB
    DirectMap4k:      151552 kB
    DirectMap2M:    12427264 kB
    DirectMap1G:     4194304 kB
    

    查看操作系统信息

    uname -a (查看当前操作系统内核信息)

    [root@myhome ~]# uname -a 
    Linux myhome.cva3.gprc.local 3.10.0-514.2.2.el7.x86_64 #1 SMP Wed Nov 16 13:15:13 EST 2016 x86_64 x86_64 x86_64 GNU/Linux
    [root@myhome ~]# 
    

    查看机器名

    cat /etc/hosts

    [root@myhome ~]$ cat /etc/hosts
    127.0.0.1 localhost.localdomain localhost
    192.168.1.203 CS.test.local CS-TEST
    [root@myhome ~]# 
    

    查看操作系统信息

    cat /etc/os-release

    [root@wex ~]# cat /etc/os-release
    NAME="Red Hat Enterprise Linux Server"
    VERSION="7.4 (Maipo)"
    ID="rhel"
    ID_LIKE="fedora"
    VARIANT="Server"
    VARIANT_ID="server"
    VERSION_ID="7.4"
    PRETTY_NAME="Red Hat"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:redhat:enterprise_linux:7.4:GA:server"
    HOME_URL="https://www.redhat.com/"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"
    
    REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
    REDHAT_BUGZILLA_PRODUCT_VERSION=7.4
    REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
    REDHAT_SUPPORT_PRODUCT_VERSION="7.4"
    [root@wex ~]# 
    

    相关文章

      网友评论

          本文标题:Linux查看硬件信息

          本文链接:https://www.haomeiwen.com/subject/iyfedxtx.html