On my Android emulator, the /system/bin folder contains several symlinks that point to the toolbox binary:
# ls -l /system/bin ls -l /system/bin [SNIP] lrwxr-xr-x root shell 2012-08-23 07:01 ls -> toolbox lrwxr-xr-x root shell 2012-08-23 07:01 lsmod -> toolbox lrwxr-xr-x root shell 2012-08-23 07:01 lsof -> toolbox [SNIP] -rwxr-xr-x root shell 181002 2012-08-23 07:01 toolbox [SNIP] #
My understanding is that 'toolbox' is a binary that is able to do everything that ls, lsmod, lsof etc... can do, and that calling 'ls -l' ends up calling 'toolbox ls -l'.
But what I don't understand is how this works: if 'ls' is indeed a symlink to 'toolbox', then 'ls -l' would become 'toolbox -l', which of course doesn't work.
What am I missing ? (or said differently: what makes 'ls -l' become 'toolbox ls -l' ?)