查看OS版本信息
[root@vt-pc-51tv ~]# cat /etc/issue
CentOS release 5.4 (Final)
Kernel \r on an \m
查看内核版本信息
[root@vt-pc-51tv ~]# uname -a
Linux vt-pc-51tv 2.6.18-164.el5 #1 SMP Thu Sep 3 03:33:56 EDT 2009 i686 i686 i386 GNU/Linux
查看挂载点和文件系统信息
[root@vt-pc-51tv ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext3 19G 2.3G 16G 13% /
/dev/sda1 ext3 99M 12M 83M 12% /boot
tmpfs tmpfs 1014M 0 1014M 0% /dev/shm
/dev/sda4 ext3 92G 13G 75G 15% /opt
查看当前分区信息
[root@vt-pc-51tv ~]# fdisk -l
Disk /dev/sda: 440.0 GB, 440087347200 bytes
255 heads, 63 sectors/track, 53504 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2563 20482875 83 Linux
/dev/sda3 2564 2824 2096482+ 82 Linux swap / Solaris
/dev/sda4 2825 14983 97667167+ 83 Linux
查看当前内存使用信息
[root@vt-pc-51tv ~]# free -m
total used free shared buffers cached
Mem: 2026 1960 65 0 158 1560
-/+ buffers/cache: 241 1785
Swap: 2047 0 2047
查看系统进程信息
[root@vt-pc-51tv~]# top
top - 04:12:21 up 12 min, 2 users, load average: 0.00, 0.16, 0.21
Tasks: 50 total, 2 running, 48 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0% us, 0.3% sy, 0.0% ni, 96.3% id, 3.3% wa, 0.0% hi, 0.0% si
Mem: 515400k total, 412956k used, 102444k free, 27192k buffers
Swap: 2048276k total, 0k used, 2048276k free, 324300k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 16 0 3156 552 472 S 0.0 0.1 0:00.93 init
2 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/0
查看系统当前日期
[root@vt-pc-51tv ~]# date
Fri Jun 18 14:04:14 CST 2010
查看系统当前时间
[root@vt-pc-51tv ~]# uptime
14:04:44 up 21 days, 17:06, 2 users, load average: 0.00, 0.00, 0.00
查看系统当前所在区域及UTC信息
[root@vt-pc-51tv~]# cat /etc/sysconfig/clock
ZONE="Asia/Shanghai"
UTC=false
ARC=false
指定查看文件系统信息
[root@vt-pc-51tv~]# file -s /dev/hda1
/dev/hda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files)
查看系统主机名信息
[root@vt-pc-51tv ~]# hostname
vt-pc-51tv
[root@vt-pc-51tv ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=vt-pc-51tv
查看DNS设置信息
[root@vt-pc-51tv ~]# cat /etc/resolv.conf
nameserver 202.96.199.133
查看系统启动信息
[root@vt-pc-51tv~]# dmesg | more
Linux version 2.6.9-78.EL (
[email protected]) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1
Thu Jul 24 23:46:01 EDT 2008
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000001fef0000 (usable)
查看CPU信息
[root@vt-pc-51tv ~]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Xeon(TM) CPU 3.40GHz
stepping : 3
cpu MHz : 3392.030
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl est cid cx16 xtpr
bogomips : 6784.06
查看CPU位数
[root@vt-pc-51tv ~]# getconf LONG_BIT
32
查看内存信息
[root@vt-pc-51tv ~]# cat /proc/meminfo
MemTotal: 515400 kB
MemFree: 103020 kB
Buffers: 26952 kB
Cached: 324172 kB
SwapCached: 0 kB
Active: 76848 kB
Inactive: 281484 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 515400 kB
LowFree: 103020 kB
SwapTotal: 2048276 kB
SwapFree: 2048276 kB
Dirty: 32 kB
Writeback: 0 kB
Mapped: 13428 kB
Slab: 44752 kB
CommitLimit: 2305976 kB
Committed_AS: 50648 kB
PageTables: 900 kB
VmallocTotal: 499704 kB
VmallocUsed: 2808 kB
VmallocChunk: 496472 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 4096 kB
查看当前网卡配置信息
[root@vt-pc-51tv ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:84:F8:33
inet addr:192.168.1.90 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe84:f833/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1249 errors:0 dropped:0 overruns:0 frame:0
TX packets:826 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:78415 (76.5 KiB) TX bytes:142077 (138.7 KiB)
Interrupt:185 Base address:0x2000
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:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:900 (900.0 b) TX bytes:900 (900.0 b)
查看网卡接品硬件信息
[root@vt-pc-51tv ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes
查看主板序列号
[root@vt-pc-51tv ~]# dmidecode | grep -i serial number
Serial Number: VMware-56 4d 0c b2 74 eb 6b 29-ea bd ea e0 97 84 f8 33
查看主板信息
[root@vt-pc-51tv ~]# lspci
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07.2 USB Controller: Intel Corporation 82371AB/EB/MB PIIX4 USB
00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
00:0f.0 VGA compatible controller: VMware Inc Abstract SVGA II Adapter
00:10.0 SCSI storage controller: BusLogic BT-946C (BA80C30) [MultiMaster 10] (rev 01)
00:11.0 PCI bridge: VMware Inc: Unknown device 0790 (rev 01)
02:00.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
02:02.0 USB Controller: VMware Inc Abstract USB2 EHCI Controller
查看鼠标键盘信息
[root@localhost ~]# cat /proc/bus/input/devices
I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
H: Handlers=kbd event0
B: EV=120013
B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7
I: Bus=0011 Vendor=0002 Product=0006 Version=0000
N: Name="ImPS/2 Generic Wheel Mouse"
P: Phys=isa0060/serio1/input0
H: Handlers=mouse0 event1
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103
查看USB设备信息
[root@vt-pc-51tv ~]# cat /proc/bus/usb/devices
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.9-78.EL uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:07.2
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 6
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.9-78.EL ehci_hcd
S: Product=EHCI Host Controller
S: SerialNumber=0000:02:02.0
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=256ms