分类: LINUX
2010-11-29 13:34:58
1.uname
[root@huanxiangwu boot]# uname -r //显示内核版本
2.6.18-194.3.1.el5
[root@huanxiangwu boot]# uname -a //显示可用的所有的内核相关信息
Linux huanxiangwu.com 2.6.18-194.3.1.el5 #1 SMP Thu May 13 13:09:10 EDT 2010 i686 i686 i386 GNU/Linux
2.dmesg
[root@huanxiangwu boot]# dmesg | less //显示内核环状缓冲区的内容
Linux version 2.6.18-194.3.1.el5 (mockbuild@builder10.centos.org) (gcc
version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Thu May 13 13:09:10
EDT 2010
BIOS-provided physical RAM map:
BIOS-e820: 0000000000010000 – 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 – 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 – 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 – 000000000fff0000 (usable)
BIOS-e820: 000000000fff0000 – 0000000010000000 (ACPI data)
BIOS-e820: 00000000fffc0000 – 0000000100000000 (reserved)
0MB HIGHMEM available.
255MB LOWMEM available.
Memory for crash kernel (0×0 to 0×0) notwithin permissible range
disabling kdump
Using x86 segment limits to approximate NX protection
On node 0 totalpages: 65520
DMA zone: 4096 pages, LIFO batch:0
Normal zone: 61424 pages, LIFO batch:15
DMI 2.5 present.
说明:内核环状缓冲区存放着内核启动过程相关的信息
/var/log/message* 文件也保存着内核处理的相关信息
3.lsmod
[root@huanxiangwu boot]# lsmod //显示内核模块信息(已装载模块的名称、大小以及这些模块的其他模块)
Module Size Used by
autofs4 29253 3
hidp 23105 2
l2cap 29505 5 hidp
bluetooth 53925 2 hidp,l2cap
lockd 63337 0
sunrpc 146685 2 lockd
ip_conntrack_netbios_ns 6977 0
ipt_REJECT 9665 1
xt_state 6209 3
ip_conntrack 53281 2 ip_conntrack_netbios_ns,xt_state
nfnetlink 10713 1 ip_conntrack
iptable_filter 7105 1
ip_tables 17029 1 iptable_filter
4.modinfo
[root@huanxiangwu boot]# modinfo ip_tables //显示特定模块(例:ip_tables)的详细信息
filename: /lib/modules/2.6.18-194.3.1.el5/kernel/net/ipv4/netfilter/ip_tables.ko
description: IPv4 packet filter
author: Netfilter Core Team
license: GPL
srcversion: 957A47CFF2E741E59A9CD83
depends: x_tables
vermagic: 2.6.18-194.3.1.el5 SMP mod_unload 686 REGPARM 4KSTACKS gcc-4.1
module_sig:
883f3504bec3970bce1b286452b2361124a7009e306060f0fa9599956c499be620902e82dafc43409e3558decefd81d7bbad7733308efe2df9f556f
5.modprobe
[root@huanxiangwu boot]# modprobe -l|grep iptable //列出所有模块后查找iptable
/lib/modules/2.6.18-194.3.1.el5/kernel/net/ipv4/netfilter/iptable_filter.ko
/lib/modules/2.6.18-194.3.1.el5/kernel/net/ipv4/netfilter/iptable_mangle.ko
/lib/modules/2.6.18-194.3.1.el5/kernel/net/ipv4/netfilter/iptable_nat.ko
/lib/modules/2.6.18-194.3.1.el5/kernel/net/ipv4/netfilter/iptable_raw.ko
[root@huanxiangwu boot]# modprobe iptable_nat //装载iptable_nat模块
[root@huanxiangwu boot]# modprobe -r -c iptable_nat //移除iptable_nat模块
6.sysctl
[root@huanxiangwu boot]# sysctl -a | less //列出所有内核参数
sunrpc.max_resvport = 1023
sunrpc.min_resvport = 665
sunrpc.tcp_slot_table_entries = 16
sunrpc.udp_slot_table_entries = 16
sunrpc.nlm_debug = 0
sunrpc.nfsd_debug = 0
sunrpc.nfs_debug = 0
sunrpc.rpc_debug = 0
crypto.fips_enabled = 0
dev.parport.default.spintime = 500
dev.parport.default.timeslice = 200
dev.cdrom.check_media = 0
dev.cdrom.lock = 1
dev.cdrom.debug = 0
dev.cdrom.autoeject = 0
dev.cdrom.autoclose = 1
dev.cdrom.info = CD-ROM information, Id: cdrom.c 3.20 2003/12/17
[root@huanxiangwu boot]# sysctl kernel.shmmax //列出特定参数的值(例:kernel.shmmax)
kernel.shmmax = 4294967295
[root@huanxiangwu boot]# sysctl -w kernel.shmmax=400000000 //设置kernel.shmmax参数的值
[root@huanxiangwu boot]# sysctl -p //从/etc/sysctl.conf载入参数
说明:/etc/sysctl.conf文件保存着内核参数值