大佬教程收集整理的这篇文章主要介绍了Linux系统下查看CPU、内存、磁盘、网卡等信息方法,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
1、 查看物理cpu的个数
[[email protected] data]# cat /proc/cpuinfo |grep "physical id"|sort|uniq|wc -l 2
2、 查看cpu是几核
[[email protected] data]# cat /proc/cpuinfo |grep "cores"|uniq cpu cores : 2
3、 查看逻辑cpu的个数
[[email protected] data]# cat /proc/cpuinfo |grep "processor"|wc -l 4
4、 查看cpu的主频
[[email protected] data]# cat /proc/cpuinfo |grep "GHz"|uniq model name : Intel(R) Core(TM) i7-7700K cpu @ 4.20GHz
[[email protected] data]# cat /proc/cpuinfo |grep name |cut -f2 -d:|uniq -c 4 Intel(R) Core(TM) i7-7700K cpu @ 4.20GHz
6、 使用lscpu命令,可以一次查看所有信息
[[email protected] data]# lscpu Architecture: x86_64 cpu op-mode(s): 32-bit,64-bit Byte Order: Little Endian cpu(s): 4 On-line cpu(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 2 NUMA node(s): 1 Vendor ID: GenuineIntel cpu family: 6 Model: 158 Model name: Intel(R) Core(TM) i7-7700K cpu @ 4.20GHz Stepping: 9 cpu MHz: 4200.007 BogoMIPS: 8400.01 Hypervisor vendor: VMware Virtualization type: full L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 8192K NUMA node0 cpu(s): 0-3 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc 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 invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec ibpb ibrs stibp arat spec_ctrl intel_stibp arch_capabilities
二、查看内存信息
1、[[email protected] data]# free -m @R_606_10586@l used free shared buff/cache available Mem: 3773 799 2245 14 728 2673 Swap: 4095 0 4095
2、 [[email protected] data]# cat /proc/meminfo Mem@R_606_10586@l: 3863568 kB MemFree: 2299312 kB MemAvailable: 2737396 kB Buffers: 2120 kB Cached: 635396 kB SwapCached: 0 kB Active: 912192 kB Inactive: 379512 kB Active(anon): 655460 kB Inactive(anon): 13852 kB Active(filE): 256732 kB Inactive(filE): 365660 kB Unevictable: 0 kB Mlocked: 0 kB Swap@R_606_10586@l: 4194300 kB SwapFree: 4194300 kB Dirty: 0 kB WriteBACk: 0 kB AnonPages: 654208 kB Mapped: 130076 kB Shmem: 15124 kB Slab: 108236 kB SReclaimable: 40620 kB SUnreclaim: 67616 kB KernelStack: 10352 kB PageTables: 40580 kB NFS_Unstable: 0 kB Bounce: 0 kB WriteBACkTmp: 0 kB CommitLimit: 6126084 kB Committed_AS: 3977456 kB Vmalloc@R_606_10586@l: 34359738367 kB VmallocUsed: 186988 kB VmallocChunk: 34359310332 kB HardwareCorrupted: 0 kB AnonHugePages: 268288 kB Cma@R_606_10586@l: 0 kB CmaFree: 0 kB HugePages_@R_606_10586@l: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 126784 kB DirectMap2M: 4067328 kB DirectMap1G: 2097152 kB
三、 查看磁盘信息
1、 查看磁盘挂载信息(常用)
[[email protected] data]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 200G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 199G 0 part ├─centos-root 253:0 0 145G 0 lvm / ├─centos-swap 253:1 0 4G 0 lvm [SWAP] └─centos-data 253:2 0 50G 0 lvm /data sr0 11:0 1 1024M 0 rom
2、 查看磁盘具体信息
[[email protected] data]# fdisk -l Disk /dev/sda: 214.7 GB,214748364800 bytes,419430400 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: 0x000a26b6 Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 419430399 208665600 8e Linux LVM Disk /dev/mapper/centos-root: 155.7 GB,155684175872 bytes,304070656 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 /dev/mapper/centos-swap: 4294 MB,4294967296 bytes,8388608 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 /dev/mapper/centos-data: 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
四、 查看网卡信息
[[email protected] data]# mii-tool ens33 #ens33表示网卡名称 ens33: negotiated 1000baseT-FD flow-control,link ok #虚拟机环境是千兆 ,link ok 表示正在连接当中
以上是大佬教程为你收集整理的Linux系统下查看CPU、内存、磁盘、网卡等信息方法全部内容,希望文章能够帮你解决Linux系统下查看CPU、内存、磁盘、网卡等信息方法所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。