CPU 主要厂家是Intel,旗下有以下产品,奔腾Pentium,赛扬Celeron,安腾 Ltanium,酷睿Core,志强Xeon,
硬盘 主要又IDE,SCSI,光纤通道和SATA,SAS等,主要使用的就是后两个
SSD最基本的组成部件:主控芯片、NAND闪存芯片、固件算法。
主要接口有 SATA3.0 mSATA M.2 PCI-E SATAExpress U.2
https://www.zhihu.com/question/20369676

CPU

lscpu非常有用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8 #总共有8核
On-line CPU(s) list: 0-7
Thread(s) per core: 2 #每个cpu核,支持2个线程
Core(s) per socket: 4 #每个cpu,有4个核
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel #cpu产商 intel
CPU family: 6
Model: 62
Stepping: 4
CPU MHz: 2500.000
BogoMIPS: 5000.00
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 30720K
NUMA node0 CPU(s): 0-7

查看CPU信息(型号)
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
8 Intel(R) Xeon(R) CPU E5410 @ 2.33GHz
(看到有8个逻辑CPU, 也知道了CPU型号)

cat /proc/cpuinfo | grep physical | uniq -c
4 physical id : 0
4 physical id : 1
(说明实际上是两颗4核的CPU)

getconf LONG_BIT
32
(说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)

cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
8
(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)

RAM

free -h

1
2
3
4
total used free shared buffers cached
Mem: 51G 47G 3.6G 2.2G 10G 13G
-/+ buffers/cache: 24G 26G
Swap: 49G 3.6G 46G

cat /proc/meminfo

1
2
3
4
5
6
7
MemTotal: 53595428 kB
MemFree: 4182288 kB
MemAvailable: 21289668 kB
Buffers: 10741116 kB
Cached: 13546460 kB
SwapCached: 204204 kB
...

大概50多G,与上面一致。

DISK

mount |column -t

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=qq)

lsblk

1
2
3
4
5
6
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 8G 0 disk
├─sda1 8:1 0 7G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 1022M 0 part [SWAP]
sr0 11:0 1 1024M 0 rom #光驱

fdisk -l

1
2
3
4
5
6
7
8
9
10
11
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 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 identifier: 0x00001761
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 14680063 7339008 83 Linux
/dev/sda2 14682110 16775167 1046529 5 Extended
/dev/sda5 14682112 16775167 1046528 82 Linux swap / Solaris

还有/proc/diskstats/etc/fstab文件

Network

IP

ifconfig -a

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
eth0 Link encap:Ethernet HWaddr 08:00:27:63:df:98
inet addr:192.168.10.102 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe63:df98/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:35811 errors:0 dropped:0 overruns:0 frame:0
TX packets:29306 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39992904 (39.9 MB) TX bytes:2241282 (2.2 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:98866 errors:0 dropped:0 overruns:0 frame:0
TX packets:98866 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:41232743 (41.2 MB) TX bytes:41232743 (41.2 MB)

DNS

cat /etc/resolv.conf

Route

route -n

1
2
3
4
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.10.1 0.0.0.0 UG 0 0 0 eth0
192.168.10.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0

netstat -rn

1
2
3
4
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.10.1 0.0.0.0 UG 0 0 0 eth0
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

Firewall

iptables -L

1
2
3
4
5
6
7
8
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Network Adapters

lspci |grep Eth

1
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)

SYSTEM

1
2
3
4
5
6
7
uname -a # 查看内核/操作系统/CPU信息
head -n 1 /etc/issue # 查看操作系统版本
hostname # 查看计算机名
lspci # 列出所有PCI设备(主板,硬盘等)
lsusb # 列出所有USB设备
lsmod # 列出加载的内核模块
env # 查看环境变量

USER

1
2
3
4
5
6
# w # 查看活动用户
# id <用户名> # 查看指定用户信息
# last # 查看用户登录日志
# cut -d: -f1 /etc/passwd # 查看系统所有用户
# cut -d: -f1 /etc/group # 查看系统所有组
# crontab -l # 查看当前用户的计划任务

参考
https://my.oschina.net/hunterli/blog/140783