android 4.0.3 串口输入ifconfig ,busybox ifconfig 执行结果不同

http://blog.csdn.net/zvivi521/article/details/9038133

执行ifconfig eth0

eth0: ip 192.168.1.104 mask 255.255.255.0 flags [up broadcast running multicast]

执行

busybox ifconfig

eth0      Link encap:Ethernet  HWaddr 00:11:22:33:44:55  
          inet addr:192.168.1.104  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::211:22ff:fe33:4455/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:537505 errors:0 dropped:918 overruns:0 frame:0
          TX packets:2479 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:45678848 (43.5 MiB)  TX bytes:699618 (683.2 KiB)
          Interrupt:83 


lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:64 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4704 (4.5 KiB)  TX bytes:4704 (4.5 KiB)


难道系统中存在两个这个命令吗?

果然

find -name ifconfig                                           
./system/busybox/sbin/ifconfig
./system/bin/ifconfig


看来默认执行的是system/bin下面的命令。

打印path

PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/system/busybox/bin:/system/busybox/sbin

echo $PATH                                                    
/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin:/system/busybox/bin:/system/busybox/sbin

/system/bin/ifconfig 是放在PATH路径前面的,就先执行这个了。要想默认执行busybox里面的,要把路径/system/busybox/sbin放在/system/bin目录前面。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值