环境变量种的路径变量修改成功,但是无法生效
bzcnc 2009-02-22 06:09:26 bzjfcx用户是普通用户,
[bzjfcx@localhost /home/bzjfcx]$ifconfig
-bash: ifconfig: command not found
[bzjfcx@localhost /home/bzjfcx]$/sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:65:A0:C0
inet addr:134.43.9.208 Bcast:134.43.9.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11058 errors:0 dropped:0 overruns:0 frame:0
TX packets:320 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:5565801 (5.3 Mb) TX bytes:23041 (22.5 Kb)
Interrupt:10 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1384 (1.3 Kb) TX bytes:1384 (1.3 Kb)
[bzjfcx@localhost /home/bzjfcx]$
鉴于上面的情况,我想需要修改环境变量,这样就不用使用绝对路径来调用命令了,因此我修改了/home/bzjfcx/.bash_profile中的PATH内容,修改后,我执行source .bash_profile,发现$PATH已经按照原来想的那样发生了变化,如下:
[bzjfcx@localhost /home/bzjfcx]$echo $PATH
/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/home/bzjfcx/bin:/sbin/ifconfig
[bzjfcx@localhost /home/bzjfcx]$
但是我在执行ifconfig命令的时候,仍然报错,不知道为何?