一:查看cpu:
[zko@localhost ~]$ more /proc/cpuinfo | grep "model name"
model name : Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz
[zko@localhost ~]$ grep "model name" /proc/cpuinfo | cut -f2 -d:
Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz
二:查看内存:
[zko@localhost ~]$ cat /proc/meminfo| grep "MemTotal"
MemTotal: 889732 kB
[zko@localhost ~]$ free | grep "Mem:" | awk '{print $2}'
889732
三:查看cpu是32位还是64位:
[zko@localhost ~]$ getconf LONG_BIT
64
[zko@localhost ~]$ echo $HOSTTYPE
x86_64
[zko@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux
四:查看当前linux的版本
[zko@localhost ~]$ cat /etc/issue
CentOS release 6.2 (Final)
Kernel \r on an \m
五:查看内核版本
[zko@localhost ~]$ uname -r
2.6.32-220.el6.x86_64
六:查看当前时间
[root@localhost zko]# date
Wed Oct 8 11:11:58 CST 2014
七:查看硬盘和分区
[root@localhost zko]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_zko-lv_root
14G 2.6G 11G 19% /
tmpfs 435M 112K 435M 1% /dev/shm
/dev/sda1 485M 33M 427M 8% /boo
[root@localhost zko]# fdisk -l
Disk /dev/sda: 17.2 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 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: 0x0006561e
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 2089 16264192 8e Linux LVM
Disk /dev/mapper/vg_zko-lv_root: 14.8 GB, 14805893120 bytes
255 heads, 63 sectors/track, 1800 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: 0x00000000
Disk /dev/mapper/vg_zko-lv_root doesn't contain a valid partition table
Disk /dev/mapper/vg_zko-lv_swap: 1845 MB, 1845493760 bytes
255 heads, 63 sectors/track, 224 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: 0x00000000
Disk /dev/mapper/vg_zko-lv_swap doesn't contain a valid partition table
查看目录大小:
[root@localhost zko]# du /var/www -sh
23M /var/www
八:查看安装的软件包:
[root@localhost zko]# rpm -aq
prelink-0.4.6-3.el6.x86_64
libpciaccess-0.12.1-1.el6.x86_64
udev-147-2.40.el6.x86_64
liberation-fonts-common-1.05.1.20090721-4.el6.noarch
xdg-user-dirs-gtk-0.8-7.el6.x86_64
ConsoleKit-libs-0.4.1-3.el6.x86_64
..............(省略)........................
[root@localhost zko]# rpm -aq | wc -l
895
[root@localhost zko]# yum list installed | wc -l
907
//有点奇怪哎。。。。。。。。。。
九:查看键盘布局:
[root@localhost zko]# cat /etc/sysconfig/keyboard
KEYTABLE="us"
MODEL="pc105+inet"
LAYOUT="us"
KEYBOARDTYPE="pc"
[root@localhost zko]# cat /etc/sysconfig/keyboard | grep KEYTABLE | cut -f2 -d=
"us"
十:查看selinux情况:
[root@localhost zko]# sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 24
Policy from config file: targeted
[root@localhost zko]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
十一:查看ip,mac地址
[root@localhost zko]# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:CC:87:CD
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fecc:87cd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1778 errors:0 dropped:0 overruns:0 frame:0
TX packets:1805 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:164320 (160.4 KiB) TX bytes:224045 (218.7 KiB)
..................(省略)...................................
[root@localhost zko]# ifconfig eth0 |grep "inet addr:" |awk '{print $2}'| cut -d ':' -f2
192.168.1.102
//查看网关
[root@localhost zko]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
//查看dns
[root@localhost zko]# cat /etc/resolv.conf
# Generated by NetworkManager
domain domain
search domain
nameserver 202.103.225.68
nameserver 202.103.224.68
十二:查看默认语言
[root@localhost zko]# echo $LANG
en_US.UTF-8
十三:查看所属时区和是否使用UTC时间
[root@localhost zko]# cat /etc/sysconfig/clock
# The time zone of the system is defined by the contents of /etc/localtime.
# This file is only for evaluation by system-config-date, do not rely on its
# contents elsewhere.
ZONE="Asia/Shanghai"
十四:查看主机名
[root@localhost zko]# hostname
localhost.localdomain