Linux CentOS查看硬件信息大全

在企业安全运维的过程,系统资产是非常重要的环节,下面的Linux命令是针对硬件信息的收集,如果这个写成自动化脚本,可以极大提高工作效率。1、CentOS常用命令查看 CPU
[root@bogon ~]# more /proc/cpuinfo | grep "model name"
model name : Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
[root@bogon ~]#
2、CentOS常用命令查看内存
[root@bogon ~]# free -m
total used free shared buffers cached
Mem: 980 765 215 0 42 411
-/+ buffers/cache: 311 668
Swap: 1983 0 1983
[root@bogon ~]#
3、CentOS常用命令查看cpu是32位还是64位​
[root@bogon ~]# getconf LONG_BIT
64
[root@bogon ~]#
4、使用CentOS常用命令查看当前linux的版本​
[root@bogon ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
[root@bogon ~]#
5、使用CentOS常用命令查看内核版本​
[root@bogon ~]# uname -a
Linux bogon 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@bogon ~]# uname -r
2.6.32-431.el6.x86_64
[root@bogon ~]# 

6、使用CentOS常用命令查看硬盘和分区​
[root@bogon ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 18G 2.7G 14G 17% /
tmpfs 491M 80K 491M 1% /dev/shm
/dev/sda1 291M 34M 242M 13% /boot
/dev/sr0 4.2G 4.2G 0 100% /media/CentOS_6.5_Final
[root@bogon ~]#
7、使用CentOS常用命令查看键盘布局
[root@bogon ~]# cat /etc/sysconfig/keyboard
KEYTABLE="us"
MODEL="pc105+inet"
LAYOUT="us"
KEYBOARDTYPE="pc"
[root@bogon ~]#
8、使用CentOS常用命令查看selinux情况​
[root@bogon ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
[root@bogon ~]#
9、查看IP地址
[root@bogon ~]# ifconfig 
eth0 Link encap:Ethernet HWaddr 00:0C:29:AD:6F:DC
inet addr:192.168.0.103 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fead:6fdc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:391924 errors:0 dropped:0 overruns:0 frame:0
TX packets:10831 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:71665413 (68.3 MiB) TX bytes:816104 (796.9 KiB)

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:16436 Metric:1
RX packets:164 errors:0 dropped:0 overruns:0 frame:0
TX packets:164 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:14626 (14.2 KiB) TX bytes:14626 (14.2 KiB)

[root@bogon ~]#
10、使用CentOS常用命令查看所属时区和是否使用UTC时间
[root@bogon ~]# cat /etc/sysconfig/clock
ZONE="America/Los_Angeles"
[root@bogon ~]#
11、使用CentOS常用命令查看主机名​
[root@bogon ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
[root@bogon ~]#
12、使用CentOS常用命令查看开机运行时间
[root@bogon ~]# uptime
20:18:41 up 5:16, 3 users, load average: 0.00, 0.00, 0.04
[root@bogon ~]#
13、查看主板信息
[root@bogon ~]# dmidecode |more
# dmidecode 2.11
SMBIOS 2.7 present.
620 structures occupying 29188 bytes.
Table at 0x000E0010.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: Phoenix Technologies LTD
Version: 6.00
Release Date: 07/02/2015
Address: 0xEA5E0
Runtime Size: 88608 bytes
ROM Size: 64 kB
Characteristics:
ISA is supported
PCI is supported
PC Card (PCMCIA) is supported
PNP is supported
APM is supported
BIOS is upgradeable
BIOS shadowing is allowed
ESCD support is available
Boot from CD is supported
Selectable boot is supported
EDD is supported
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
CGA/mono video services are supported (int 10h)
ACPI is supported
Smart battery
14、查看磁盘使用情况
[root@bogon ~]# 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: 0x000ce1a7

Device Boot Start End Blocks Id System
/dev/sda1 * 1 39 307200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 39 2358 18631680 83 Linux
/dev/sda3 2358 2611 2031616 82 Linux swap / Solaris

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 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: 0x084395f5

Device Boot Start End Blocks Id System
/dev/sdb1 1 652 5237158+ 83 Linux
[root@bogon ~]#

0 个评论

要回复文章请先登录注册