1. lscpu:
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
2. cat /proc/cpuinfo:
可以看到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
3. free -m:
概要查看内存情况: free -m,下面是查寻的信息,总共980M。
total used free shared buffers cached Mem: 980 309 671 0 22 121 -/+ buffers/cache: 165 815 Swap: 2047 0 2047
4. cat /proc/meminfo
查看内存详细使用:# cat /proc/meminfo
MemTotal: 1004348 kB MemFree: 687056 kB Buffers: 22948 kB Cached: 124724 kB SwapCached: 0 kB
5. lsblk:
查看硬盘和分区分布:# 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
6. fdisk -l:
要详细查看硬盘情况: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
7. df -h:
查看磁盘分区: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