1、如何修改ip地址
即時(shí)生效:
# ifconfig eth0 192.168.0.20 netmask 255.255.255.0
啟動(dòng)生效:
修改/etc/sysconfig/network-scripts/ifcfg-eth0
2、如何修改default gateway
即時(shí)生效:
# route add default gw 192.168.0.254
啟動(dòng)生效:
修改/etc/sysconfig/network-scripts/ifcfg-eth0
修改dns
修改/etc/resolv.conf
修改后可即時(shí)生效,啟動(dòng)同樣有效
重啟網(wǎng)卡命令:service network restart
service iptables stop
如何設(shè)置中文環(huán)境
/etc/profile增加
export LANG=zh_CN.GB2312
export LC_ALL=zh_CN.GB2312
#source /etc/profile生效
如何查看cpu信息
#cat /proc/cpuinfo
如何查看位數(shù)
#file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
即是32位的 linux, 如是64位的, 顯示的是 64-bit
如何查看Linux發(fā)行版本號(hào):
2.1 cat /etc/issue #查看issue文件
顯示舉例:
Fedora release 7 (Moonshine)
Kernel \r on an \m
2.2 lsb_release -a #用命令查看發(fā)行版本信息
顯示舉例:
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