1、如何修改ip地址
即时生效:
# ifconfig eth0 192.168.0.20 netmask 255.255.255.0
启动生效:
修改/etc/sysconfig/network-scripts/ifcfg-eth0
2、如何修改default gateway
即时生效:
# route add default gw 192.168.0.254
启动生效:
修改/etc/sysconfig/network-scripts/ifcfg-eth0
修改dns
修改/etc/resolv.conf
修改后可即时生效,启动同样有效
重启网卡命令:service network restart
service iptables stop
如何设置中文环境
/etc/profile增加
export LANG=zh_CN.GB2312
export LC_ALL=zh_CN.GB2312
#source /etc/profile生效
如何查看cpu信息
#cat /proc/cpuinfo
如何查看位数
#file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
即是32位的 linux, 如是64位的, 显示的是 64-bit
如何查看Linux发行版本号:
2.1 cat /etc/issue #查看issue文件
显示举例:
Fedora release 7 (Moonshine)
Kernel \r on an \m
2.2 lsb_release -a #用命令查看发行版本信息
显示举例:
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: Fedora
Description: Fedora release 7 (Moonshine)
Release: 7
Codename: Moonshine