分类: LINUX
2009-01-07 09:55:56
#------------------------------------------------------------------------
# 服务器信息查看
#------------------------------------------------------------------------
1.查看版本,内核
cat /etc/issue
2.查看cpu,mem
grep "model name" /proc/cpuinfo
grep MemTotal /proc/meminfo
free
3. 内存的插槽数,已经使用多少插槽.每条内存多大,已使用内存多大
dmidecode | grep -P -A 5 "Memory\s+Device" | grep Size | grep -v Range
Size: 2048 MB
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
4. 支持的最大内存容量
dmidecode | grep -P 'Maximum\s+Capacity'
Maximum Capacity: 64 GB
5. 查看内存的频率
dmidecode | grep -A16 "Memory Device"
dmidecode | grep -A16 "Memory Device" | grep 'Speed'
6.查看操作系统位数
getconf LONG_BIT
#------------------------------------------------------------------------
# 基本设置
#------------------------------------------------------------------------
# 设置主机名
vi /etc/sysconfig/network
HOSTNAME=centos
reboot system...
# ifconfig eth0 192.168.4.222 netmask 255.255.255.0
# ifconfig eth0:0 10.0.0.1 netmask 255.0.0.0
# ifconfig eth0 down
# ifconfig eth0 on
# 更改网卡MAC地址
ifconfig eth0 hw ether 00:37:A6:C4:68:E3
# route命令设置网关
route add default gw 192.168.4.3
route del default gw 192.168.4.1
# 查看端口信息
netstat -atn
# 查看路由表
netstat -r
# 查看网络接口状态
netstat -i
--------------------------------------------------------------------
# 增加环境变量
echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile //永久修改的
source /etc/profile
--------------------------------------------------------------------