最新要闻

广告

手机

iphone11大小尺寸是多少?苹果iPhone11和iPhone13的区别是什么?

iphone11大小尺寸是多少?苹果iPhone11和iPhone13的区别是什么?

警方通报辅警执法直播中被撞飞:犯罪嫌疑人已投案

警方通报辅警执法直播中被撞飞:犯罪嫌疑人已投案

家电

环球即时看!查看Linux系统下CPU、内存、硬盘等信息

来源:博客园

做个记录,方便日后查看使用。

1. 查看CPU


(相关资料图)

1.1 查看CPU个数

[root@qy-ggyf-zyl-31 ~]# cat /proc/cpuinfo | grep "physical id" | uniq | wc -l8

1.2 查看CPU详情

[root@qy-ggyf-zyl-31 ~]# cat /proc/cpuinfoprocessor       : 0vendor_id       : GenuineIntelcpu family      : 6model           : 94model name      : Intel Core Processor (Skylake)stepping        : 3microcode       : 0x1cpu MHz         : 2194.842cache size      : 4096 KBphysical id     : 0siblings        : 1core id         : 0cpu cores       : 1apicid          : 0initial apicid  : 0fpu             : yesfpu_exception   : yescpuid level     : 13wp              : yesflags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f rdseed adx smap clflushopt avx512cd xsaveopt xsavec xgetbv1 aratbogomips        : 4389.68clflush size    : 64cache_alignment : 64address sizes   : 46 bits physical, 48 bits virtualpower management:

1.3 查看CPU型号

[root@qy-ggyf-zyl-31 ~]# cat /proc/cpuinfo | grep "model name" |uniqmodel name      : Intel Core Processor (Skylake)

2. 查看内存

2.1 查看内存总数

[root@qy-ggyf-zyl-31 ~]# cat /proc/meminfo |grep MemTotalMemTotal:       32775916 kB

2.2 查看内存详情

[root@qy-ggyf-zyl-31 ~]# cat /proc/meminfoMemTotal:       32775916 kBMemFree:        24031996 kBMemAvailable:   29836020 kBBuffers:          157888 kBCached:          7458304 kBSwapCached:            0 kBActive:          3515628 kBInactive:        4711068 kBActive(anon):    1625168 kBInactive(anon):   575904 kBActive(file):    1890460 kBInactive(file):  4135164 kB

3. 查看硬盘

3.1 查看硬盘大小

[root@cwcsb-gxcwy832-xnce-2 upload]# fdisk -l |grep DiskDisk /dev/vda: 107.4 GB, 107374182400 bytes, 209715200 sectorsDisk label type: dosDisk identifier: 0x000ba968Disk /dev/vdb: 536.9 GB, 536870912000 bytes, 1048576000 sectors

3.2 查看硬盘使用情况

[root@cwcsb-gxcwy832-xnce-2 upload]# df -hFilesystem      Size  Used Avail Use% Mounted on/dev/vda2       100G   49G   52G  49% /devtmpfs         16G     0   16G   0% /devtmpfs            16G     0   16G   0% /dev/shmtmpfs            16G   17M   16G   1% /runtmpfs            16G     0   16G   0% /sys/fs/cgroup/dev/vda1       485M  130M  356M  27% /boottmpfs           3.2G     0  3.2G   0% /run/user/1001

4. 查看文件夹

4.1 查看当前目录下文件和文件夹数

[root@cwcsb-gxcwy832-xnce-2 upload]# ls |wc -l11

4.2 查看当前目录总大小

[root@cwcsb-gxcwy832-xnce-2 upload]# du -sh3.1G    .

4.3 查看当前目录下各文件和文件夹大小

注:此举可以快速定位大文件所存在的位置。

[root@cwcsb-gxcwy832-xnce-2 upload]# du -sh *1.2G    BOOT-INF144K    exp_cwy_GX1009_1104.log3.4M    HDTool3.0M    HDTool.zip144K    imp_cwy_GX1009_1028.log84K     nohup.out1.8G    olk101M    promtail4.0K    sendstartup.sh36M     telegraf-1.21.4-1.x86_64.rpm8.0K    update_aun.sh[root@cwcsb-gxcwy832-xnce-2 upload]# lsBOOT-INF                 HDTool      imp_cwy_GX1009_1028.log  olk       sendstartup.sh                update_aun.shexp_cwy_GX1009_1104.log  HDTool.zip  nohup.out                promtail  telegraf-1.21.4-1.x86_64.rpm

4.4 查看当前目录下各文件和文件夹(含下一级目录)大小

[root@cwcsb-gxcwy832-xnce-2 upload]# du -h --max-depth=1 *1.2G    BOOT-INF/classes19M     BOOT-INF/lib1.2G    BOOT-INF144K    exp_cwy_GX1009_1104.log3.4M    HDTool3.0M    HDTool.zip144K    imp_cwy_GX1009_1028.log84K     nohup.out12K     olk/META-INF420K    olk/org1.2G    olk/BOOT-INF1.8G    olk101M    promtail4.0K    sendstartup.sh36M     telegraf-1.21.4-1.x86_64.rpm8.0K    update_aun.sh

4.5 指定显示文件或文件夹大小

[root@cwcsb-gxcwy832-xnce-2 upload]# du -h --max-depth=0 /opt/cwy8.325.8G    /opt/cwy8.32[root@cwcsb-gxcwy832-xnce-2 upload]# du -h --max-depth=1 /opt/cwy8.328.0K    /opt/cwy8.32/config1.6G    /opt/cwy8.32/middleware4.2G    /opt/cwy8.32/product5.8G    /opt/cwy8.32[root@cwcsb-gxcwy832-xnce-2 upload]# du -h --max-depth=1 BOOT-INF/1.2G    BOOT-INF/classes19M     BOOT-INF/lib1.2G    BOOT-INF/[root@cwcsb-gxcwy832-xnce-2 upload]# du -h --max-depth=1exp_cwy_GX1009_1104.log144K    exp_cwy_GX1009_1104.log

5. 查看Linux系统

5.1 查看Linux内核版本信息

[root@cwcsb-gxcwy832-xnce-2 upload]# uname -aLinux cwcsb-gxcwy832-xnce-2 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux[root@cwcsb-gxcwy832-xnce-2 upload]# cat /proc/versionLinux version 3.10.0-957.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018[root@cwcsb-gxcwy832-xnce-2 upload]# cat /proc/versionLinux version 3.10.0-957.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018

5.2 查看Linux系统版本信息

[root@cwcsb-gxcwy832-xnce-2 upload]# cat /etc/redhat-releaseCentOS Linux release 7.6.1810 (Core)[root@cwcsb-gxcwy832-xnce-2 upload]# cat /etc/centos-releaseCentOS Linux release 7.6.1810 (Core)

关键词: 版本信息 当前目录 使用情况