• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Busybox commands don't replace kernel commands

remmons

Lurker
I installed Busybox, but the old native kernel commands still run. For example, if I start an adb shell and type:

ls -la

I get the error message "-la: no such file or directory", but if I type:

busybox ls -la

I get the expected directory listing.

Is there a way to get the busybox versions of the command to run instead of the native kernel versions?
 
Do a which ls to find what path it's using.
Then do find / -name ls, to see if there are multiple commands.

If you find another one, try that one with the options you want, then change your path.
 
Do a which ls to find what path it's using.
Then do find / -name ls, to see if there are multiple commands.

If you find another one, try that one with the options you want, then change your path.

Thanks, I have found 2 ls commands:

/system/bin/ls
and
/system/xbin/ls

"/system/xbin/ls" does what I want, but

which ls says "/system/bin/ls"

cat $PATH says "/sbin:/vendor/bin:system/sbin:/system/bin:/system/xbin"

I assume that since "/system/bin/ls" is listed before "/system/xbin/ls" it runs. If I can reverse the order it should run. I thought $PATH would be defined in a "$HOME/.profile", but I find no such file.

Where is $PATH defined?
 
Look for ~local_profile.

If not there try /.profile.
I think it depends on your terminal emulator.

Thanks again for the info, but I do not seem to have any files on my system named anything like "profile". I ran "ls -laFR" and directed its output to a text file. Next I used an editor to search for "profile". I found only 2 instances of "profile". One was an empty directory. The other was a file named "media_profiles.xml". It does not seem to have anything to do with my problem.

Is there some other place where Android's $PATH might be set?
 
Back
Top Bottom