在虚拟机中安装linux后想进行ftp通信,结果出现ifconfig not found :
[oracle@localhost /]$ ifconfig
提示:“bash: ifconfig: command not found”
分析问题
1.whereis ifconfig 看一下这个命令在哪个目录下
2.echo $PATH 看一下该目录是否在路经下,注意lunux下是完全区分大小写的,所以不要忽略这点
方法一:[oracle@localhost sbin]$ /sbin/ifconfig 就可以出现使用了
方法二:[oracle@localhost sbin]$ export PATH=$PATH:/sbin ,这样设置后,下次就可以直接访问了,免处第一种的麻烦.
第2种 在切换用户后,再执行ifconfig依然 not found,进行方法3
3.
修改/etc/profile文件,注释掉if语句即可
把下面的if语句注释掉:
# Path manipulation
if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
修改为
# Path manipulation
# if [ "$EUID" = "0" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
#fi
再切换 也不怕了