实习笔记
时间:2010-06-11 来源:chris2411
2010.6.11
问题1:当ifconfig不能用了如:
[root@localhost yosnic]# ifconfig
bash: ifconfig: command not found
解决:做个软连接 /sbin/ifconfig
[root@localhost yosnic]# ln -s /sbin/ifconfig /usr/bin/ifconfig
问题2:上一问题里根本原因是环境变量没设置 当设好PATH后就能解决
root@localhost yosnic]# ifconfig
bash: ifconfig: command not found
[root@localhost yosnic]# route
bash: route: command not found
解决:设置环境变量如下
vi /root/.bash_profile 增加PATH=$PATH:$HOME/bin::/sbin
或者 [root@localhost etc]# PATH=$PATH:/sbin
小节:
问题1:当ifconfig不能用了如:
[root@localhost yosnic]# ifconfig
bash: ifconfig: command not found
解决:做个软连接 /sbin/ifconfig
[root@localhost yosnic]# ln -s /sbin/ifconfig /usr/bin/ifconfig
问题2:上一问题里根本原因是环境变量没设置 当设好PATH后就能解决
root@localhost yosnic]# ifconfig
bash: ifconfig: command not found
[root@localhost yosnic]# route
bash: route: command not found
解决:设置环境变量如下
vi /root/.bash_profile 增加PATH=$PATH:$HOME/bin::/sbin
或者 [root@localhost etc]# PATH=$PATH:/sbin
小节:
/etc/profile用于整个系统所有用户, ~/.bash_profile, ~/.profile和~/.bashrc 用于各个用户,这里的"~"符号就是各当前用户的$HOME
~/.bash_profile 和 ~/.profile 只在登陆时读取一次。
~/.bashrc 每次都读取
~/.bash_profile 和 ~/.profile 的区别在于,bash 只读取~/.bash_profile;而对于 ~/.profile 来说,不光bash, 其他shell 也读 ~/.profile
相关阅读 更多 +