Commonly used commands to view server configuration under Linux

server model

[root@k80 ~]# dmidecode|grep "System Information" -A9|egrep  "Manufacturer|Product"

    Manufacturer: Sugon

    Product Name: W580-G20

 

operating system

View current operating system release information

[root@k80 ~]# cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

 

View OS release details

[root@k80 ~]# lsb_release -a

LSB Version:    :core-4.1-amd64:core-4.1-noarch

Distributor ID: CentOS

Description:    CentOS Linux release 7.3.1611 (Core) 

Release:    7.3.1611

Codename:   Core

 

CPU

View CPU Statistics

[root@k80 ~]# lscpu

Architecture:          x86_64

CPU op-mode(s):       32-bit, 64-bit

Byte Order:            Little Endian

CPU(s):               12

On-line CPU(s) list:   0-11

Thread(s) per core:    1

Core(s) per socket:    6

Socket(s):             2

NUMA node (s): 2

Vendor ID:             GenuineIntel

CPU family:            6

Model:                 63

Model name:            Intel(R) Xeon(R) CPU E5-2609 v3 @ 1.90GHz

Stepping:              2

CPU MHz:               1780.062

BogoMIPS:              3805.02

Virtualization:        VT-x

L1d cache:             32K

L1i cache:             32K

L2 cache:              256K

L3 cache:              15360K

NUMA node0 CPU(s):     0-5

NUMA node1 CPU(s):     6-11

 

查看CPU型号

[root@k80 ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c

     12  Intel(R) Xeon(R) CPU E5-2609 v3 @ 1.90GHz

 

查看物理CPU个数

[root@k80 ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l

2

 

查看每个物理CPU中core的个数(即核数)

[root@k80 ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq

cpu cores   : 6

 

查看逻辑CPU的个数

[root@k80 ~]# cat /proc/cpuinfo| grep "processor"| wc -l

12

 

 

内存

查看概要内存使用情况

[root@k80 ~]# free -g

              total       used       free      shared  buff/cache   available

Mem:           62          8          35         2       18         51

Swap:          31          0          31

-g是以GB为单位;也可以使用-m,即以MB为单位

 

查看内存硬件信息

[root@k80 ~]# dmidecode -t memory

# dmidecode 3.0

Scanning /dev/mem for entry point.

SMBIOS 3.0 present.

 

Handle 0x002B, DMI type 16, 23 bytes

Physical Memory Array

    Location: System Board Or Motherboard

    Use: System Memory

    Error Correction Type: Multi-bit ECC

    Maximum Capacity: 256 GB

    Error Information Handle: Not Provided

    Number Of Devices: 4

 

Handle 0x002C, DMI type 17, 40 bytes

Memory Device

    Array Handle: 0x002B

    Error Information Handle: Not Provided

    Total Width: 72 bits

    Data Width: 64 bits

    Size: 32 GB

    Form Factor: DIMM

    Set: None

    Locator: P1-DIMMA1

    Bank Locator: P0_Node0_Channel0_Dimm0

    Type: DDR4

    Type Detail: Synchronous

    Speed: 2400 MHz

    Manufacturer: Samsung

    Serial Number: 35A24C2F

    Asset Tag: P1-DIMMA1_AssetTag (date:17/19)

    Part Number: M393A4K40BB1-CRC   

    Rank: 2

    Configured Clock Speed: 1600 MHz

    Minimum Voltage: Unknown

    Maximum Voltage: Unknown

    Configured Voltage: Unknown

 

查看内存详细使用情况

[root@k80 ~]# cat /proc/meminfo

MemTotal:       65683572 kB

MemFree:        35808252 kB

MemAvailable:   52288668 kB

Buffers:            1020 kB

Cached:         18199556 kB

SwapCached:            0 kB

Active:         20343632 kB

Inactive:        7164792 kB

Active(anon):    9343616 kB

Inactive(anon):  2116004 kB

Active(file):   11000016 kB

Inactive(file):  5048788 kB

Unevictable:           0 kB

Mlocked:               0 kB

SwapTotal:      32964604 kB

SwapFree:       32964604 kB

Dirty:              1384 kB

 

查看内存的插槽数,已经使用多少插槽.每条内存多大

[root@k80 ~]# dmidecode|grep -A5 "Memory Device"|grep Size|grep -v Range

    Size: 32 GB

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

    Size: 32 GB

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

    Size: No Module Installed

 

硬盘

查看硬盘和分区分布

[root@k80 ~]# lsblk

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT

sda           8:0    0 558.9G  0 disk 

├─sda1        8:1    0     1G  0 part /boot

└─sda2        8:2    0 557.9G  0 part 

  ├─cl-root 253:0    0    50G  0 lvm  /

  ├─cl-swap 253:1    0  31.4G  0 lvm  [SWAP]

  └─cl-home 253:2    0 476.5G  0 lvm  /home

sr0          11:0    1  1024M  0 rom  

 

查看硬盘和分区的详细信息

[root@k80 ~]# fdisk -l

Disk /dev/sda: 600.1 GB, 600127266816 bytes, 1172123568 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x00011d6e

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048     2099199     1048576   83  Linux

/dev/sda2         2099200  1172121599   585011200   8e  Linux LVM

 

Disk /dev/mapper/cl-root: 53.7 GB, 53687091200 bytes, 104857600 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

 

其他

查看网卡的硬件信息

[root@k80 ~]# lspci | grep -i 'eth'

81:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

81:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

 

查看显卡运行状况

[root@k80 ~]# nvidia-smi

Thu Nov 23 10:32:20 2017       

+-----------------------------------------------------------------------------+

| NVIDIA-SMI 375.26                 Driver Version: 375.26                    |

|-------------------------------+----------------------+----------------------+

| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |

| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |

|===============================+======================+======================|

|   0  Tesla K80           Off  | 0000:04:00.0     Off |                    0 |

| N/A   60C    P0    75W / 149W |   4344MiB / 11439MiB |      2%      Default |

+-------------------------------+----------------------+----------------------+

|   1  Tesla K80           Off  | 0000:05:00.0     Off |                    0 |

| N/A   43C    P0    89W / 149W |   2196MiB / 11439MiB |     15%      Default |

+-------------------------------+----------------------+----------------------+

|   2  Tesla K80           Off  | 0000:08:00.0     Off |                    0 |

| N/A   90C    P0   100W / 149W |   2196MiB / 11439MiB |     98%      Default |

+-------------------------------+----------------------+----------------------+

|   3  Tesla K80           Off  | 0000:09:00.0     Off |                    0 |

| N/A   60C    P0    87W / 149W |   4212MiB / 11439MiB |     26%      Default |

+-------------------------------+----------------------+----------------------+

 

+-----------------------------------------------------------------------------+

| Processes:                                                       GPU Memory |

|  GPU       PID  Type  Process name                               Usage      |

|=============================================================================|

|    0     25459    C   python3                                       4336MiB |

|    1     25459    C   python3                                       2188MiB |

|    2     25459    C   python3                                       2188MiB |

|    3     25459    C   python3                                       4204MiB |

+-----------------------------------------------------------------------------+

WARNING: infoROM is corrupted at gpu 0000:04:00.0

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324506444&siteId=291194637