查看Linux系统硬件信息

发表于:2015-11-26 09:28

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:Liemer_Lius    来源:51Testing软件测试网采编

  lscpu命令,查看的是cpu的统计信息,只列出一部分,如位数,核心数,缓存大小,频率。
  Architecture:          x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Little Endian
  CPU(s):                2
  CPU MHz:               2095.231
  BogoMIPS:              4190.46
  Hypervisor vendor:     VMware
  Virtualization type:   full
  L1d cache:             32K
  L1i cache:             32K
  L2 cache:              256K
  L3 cache:              3072K
  下面的方法也可以查看cpu的信息,只截取一部分信息。
  #cat /proc/cpuinfo
  vendor_id       : GenuineIntel
  model name      : Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz
  cpu MHz         : 2095.231
  cache size      : 3072 KB
  概要查看内存情况: free -m,下面是查寻的信息,总共980M。
  total       used       free     shared    buffers     cached
  Mem:           980        309        671          0         22        121
  -/+ buffers/cache:        165        815
  Swap:         2047          0       2047
  查看内存详细使用:# cat /proc/meminfo
  MemTotal:        1004348 kB
  MemFree:          687056 kB
  Buffers:           22948 kB
  Cached:           124724 kB
  SwapCached:            0 kB
  查看硬盘和分区分布:# lsblk,下面列出的信息,很直观,包括分区的名称,大小。
  NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
  sda      8:0    0   20G  0 disk
  ├─sda1   8:1    0  100M  0 part /boot
  ├─sda2   8:2    0    2G  0 part [SWAP]
  └─sda3   8:3    0 17.9G  0 part /
  sr0     11:0    1  4.3G  0 rom
  要详细查看硬盘情况:fdisk -l
  Disk /dev/sda: 21.5 GB, 21474836480 bytes
  255 heads, 63 sectors/track, 2610 cylinders
  Units = cylinders of 16065 * 512 = 8225280 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disk identifier: 0x00087e91
  Device Boot      Start         End      Blocks   Id  System
  /dev/sda1   *           1          13      102400   83  Linux
  Partition 1 does not end on cylinder boundary.
  /dev/sda2              13         274     2097152   82  Linux swap / Solaris
  Partition 2 does not end on cylinder boundary.
  /dev/sda3             274        2611    18770944   83  Linux
  查看磁盘分区:df -h,以一个比较利于阅读的显示单位来列出信息。
  -k 即--block-size=1K,显示单位为k; -x, --exclude-type=类型,只显示文件系统不是指定类型信息
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/sda3        18G  2.7G   14G  16% /
  tmpfs           491M     0  491M   0% /dev/shm
  /dev/sda1        93M   26M   63M  30% /boot
  # df -i, --inodes,显示inode 信息而非块使用量;如有时候,inode占满,硬盘的空间即使有空闲,也是不能写入数据的。
  Filesystem      Inodes  IUsed   IFree IUse% Mounted on
  /dev/sda3      1175040 101102 1073938    9% /
  tmpfs           125543      1  125542    1% /dev/shm
  /dev/sda1        25688     38   25650    1% /boot
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号