龙空技术网

linux系统中查看内存大小、硬盘大小、CPU

代码粉碎机 261

前言:

眼前大家对“linux如何查看空间大小”都比较珍视,咱们都需要剖析一些“linux如何查看空间大小”的相关资讯。那么小编同时在网上收集了一些有关“linux如何查看空间大小””的相关知识,希望姐妹们能喜欢,朋友们一起来了解一下吧!

1、内存

[root@localhost home]# cat /proc/meminfo | head -n 5MemTotal:        2035624 kB      ## 总的内存大小MemFree:          824528 kBMemAvailable:    1221384 kBBuffers:            1780 kBCached:           496032 kB
[root@localhost home]# cat /proc/meminfo | head -n 1 | awk '{print $2/(1024 * 1024),"G"}'1.94132 G
[root@localhost home]# free -h             total       used       free     shared    buffers     cachedMem:          1.9G       1.2G       782M        10M       1.7M       474M-/+ buffers/cache:       728M       1.2GSwap:         2.0G         0B       2.0G

2、硬盘

[root@localhost home]# df -hFilesystem             Size  Used Avail Use% Mounted on/dev/mapper/rhel-root   18G  3.0G   15G  17% /devtmpfs               985M     0  985M   0% /devtmpfs                  994M  136K  994M   1% /dev/shmtmpfs                  994M  8.8M  986M   1% /runtmpfs                  994M     0  994M   0% /sys/fs/cgroup/dev/sda1              497M  119M  379M  24% /boot/dev/sr0               3.5G  3.5G     0 100% /media/cdrom
[root@localhost home]# fdisk -l |grep DiskDisk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectorsDisk label type: dosDisk identifier: 0x00094211Disk /dev/mapper/rhel-root: 18.8 GB, 18798870528 bytes, 36716544 sectorsDisk /dev/mapper/rhel-swap: 2147 MB, 2147483648 bytes, 4194304 sectors

3、cpu信息

[root@localhost home]# lscpuArchitecture:          x86_64CPU op-mode(s):        32-bit, 64-bitByte Order:            Little EndianCPU(s):                1On-line CPU(s) list:   0Thread(s) per core:    1Core(s) per socket:    1Socket(s):             1NUMA node(s):          1Vendor ID:             AuthenticAMDCPU family:            23Model:                 113Model name:            AMD Ryzen 5 3600X 6-Core ProcessorStepping:              0CPU MHz:               3800.007BogoMIPS:              7600.01Virtualization:        AMD-VHypervisor vendor:     VMwareVirtualization type:   fullL1d cache:             32KL1i cache:             32KL2 cache:              512KL3 cache:              32768KNUMA node0 CPU(s):     0
[root@localhost home]# cat /proc/cpuinfo | grep "physical id" | uniq | wc -l      ## 查看物理CPU的个数1
[root@localhost home]# cat /proc/cpuinfo | grep "cpu cores" | uniq   ## 物理cpu的核心数cpu cores    : 1
[root@localhost home]# cat /proc/cpuinfo | grep 'model name' |uniq    ## cpu的型号model name    : AMD Ryzen 5 3600X 6-Core Processor

补充:物理cpu和逻辑cpu

root@PC1:/home/test# cat /proc/cpuinfo | grep 'model name' |uniq   ## 查看cpu的型号model name      : AMD Ryzen 5 3600X 6-Core Processor
root@PC1:/home/test# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l   ## 物理cpu的个数2
root@PC1:/home/test# cat /proc/cpuinfo| grep "cpu cores"| uniq     ## 每个物理cpu中的核心数cpu cores       : 4
root@PC1:/home/test# cat /proc/cpuinfo| grep "processor"| wc -l    ##逻辑cpu的个数8

标签: #linux如何查看空间大小