发布网友 发布时间:2022-04-19 22:06
共1个回答
热心网友 时间:2023-04-30 04:26
lscpu命令,查看的是cpu的统计信息.\x0d\x0ablue@blue-pc:~$ lscpu\x0d\x0aArchitecture: i686 #cpu架构\x0d\x0aCPU op-mode(s): 32-bit, -bit\x0d\x0aByte Order: Little Endian #小尾序\x0d\x0aCPU(s): 4 #总共有4核\x0d\x0aOn-line CPU(s) list: 0-3\x0d\x0aThread(s) per core: 1 #每个cpu核,只能支持一个线程,即不支持超线程\x0d\x0aCore(s) per socket: 4 #每个cpu,有4个核\x0d\x0aSocket(s): 1 #总共有1一个cpu\x0d\x0aVendor ID: GenuineIntel #cpu产商 intel\x0d\x0aCPU family: 6\x0d\x0aModel: 42\x0d\x0aStepping: 7\x0d\x0aCPU MHz: 1600.000\x0d\x0aBogoMIPS: 5986.12\x0d\x0aVirtualization: VT-x #支持cpu虚拟化技术\x0d\x0aL1d cache: 32K\x0d\x0aL1i cache: 32K\x0d\x0aL2 cache: 256K\x0d\x0aL3 cache: 6144K\x0d\x0a \x0d\x0a 查看/proc/cpuinfo,可以知道每个cpu信息,如每个CPU的型号,主频等。\x0d\x0a#cat /proc/cpuinfo\x0d\x0aprocessor : 0\x0d\x0avendor_id : GenuineIntel\x0d\x0acpu family : 6\x0d\x0amodel : 42\x0d\x0amodel name : Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz\x0d\x0a.....\x0d\x0a 上面输出的是第一个cpu部分信息,还有3个cpu信息省略了。\x0d\x0a \x0d\x0a 内存\x0d\x0a 概要查看内存情况\x0d\x0a free -m\x0d\x0a total used free shared buffers cached\x0d\x0a Mem: 3926 3651 274 0 12 404\x0d\x0a -/+ buffers/cache: 3235 691\x0d\x0a Swap: 9536 31 9505\x0d\x0a 这里的单位是MB,总共的内存是3926MB。\x0d\x0a \x0d\x0a 查看内存详细使用\x0d\x0a# cat /proc/meminfo\x0d\x0aMemTotal: 4020868 kB\x0d\x0aMemFree: 230884 kB\x0d\x0aBuffers: 7600 kB\x0d\x0aCached: 454772 kB\x0d\x0aSwapCached: 836 kB\x0d\x0a.....\x0d\x0a \x0d\x0a 查看内存硬件信息\x0d\x0admidecode -t memory\x0d\x0a# dmidecode 2.11\x0d\x0aSMBIOS 2.7 present.\x0d\x0aHandle 0x0008, DMI type 16, 23 bytes\x0d\x0aPhysical Memory Array\x0d\x0a Location: System Board Or Motherboard\x0d\x0a....\x0d\x0a Maximum Capacity: 32 GB\x0d\x0a....\x0d\x0aHandle 0x000A, DMI type 17, 34 bytes\x0d\x0a....\x0d\x0aMemory Device\x0d\x0a Array Handle: 0x0008\x0d\x0a Error Information Handle: Not Provided\x0d\x0a Total Width: bits\x0d\x0a Data Width: bits\x0d\x0a Size: 4096 MB\x0d\x0a.....\x0d\x0a 我的主板有4个槽位,只用了一个槽位,上面插了一条4096MB的内存。\x0d\x0a \x0d\x0a 磁盘\x0d\x0a 查看硬盘和分区分布\x0d\x0a# lsblk\x0d\x0aNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT\x0d\x0asda 8:0 0 465.8G 0 disk\x0d\x0a├—sda1 8:1 0 1G 0 part /boot\x0d\x0a├—sda2 8:2 0 9.3G 0 part [SWAP]\x0d\x0a├—sda3 8:3 0 74.5G 0 part /\x0d\x0a├—sda4 8:4 0 1K 0 part\x0d\x0a├—sda5 8:5 0 111.8G 0 part /home\x0d\x0a└—sda6 8:6 0 269.2G 0 part\x0d\x0a 显示很直观\x0d\x0a \x0d\x0a 如果要看硬盘和分区的详细信息\x0d\x0a# fdisk -l\x0d\x0aDisk /dev/sda: 500.1 GB, 500107862016 bytes\x0d\x0a255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors\x0d\x0aUnits = sectors of 1 * 512 = 512 bytes\x0d\x0aSector size (logical/physical): 512 bytes / 4096 bytes\x0d\x0aI/O size (minimum/optimal): 4096 bytes / 4096 bytes\x0d\x0aDisk identifier: 0x00023728\x0d\x0a Device Boot Start End Blocks Id System\x0d\x0a/dev/sda1 * 2048 2148351 1073152 83 Linux\x0d\x0a/dev/sda2 2148352 21680127 9765888 82 Linux swap / Solaris\x0d\x0a/dev/sda3 21680128 177930239 78125056 83 Linux\x0d\x0a/dev/sda4 177932286 976771071 399419393 5 Extended/dev/sda5 177932288 412305407 117186560 83 Linux\x0d\x0a/dev/sda6 412307456 976771071 282231808 83 Linux\x0d\x0a \x0d\x0a 网卡\x0d\x0a 查看网卡硬件信息\x0d\x0a# lspci | grep -i 'eth'\x0d\x0a02:00.0 Ethernet controller: Realtek Semiconctor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)\x0d\x0a \x0d\x0a 查看系统的所有网络接口\x0d\x0a# ifconfig -a\x0d\x0aeth0 Link encap:以太网 硬件地址 b8:97:5a:17:b3:8f \x0d\x0a .....\x0d\x0alo Link encap:本地环回 \x0d\x0a .....\x0d\x0a 或者是\x0d\x0aip link show\x0d\x0a1: lo: