1

In my terminal app when I type ls /? it gives me ls /d. Where can I find the other options? For example I want to list the file attributes and file length. I have tried also busybox to no avail.

  • 2
    The /? is a Windows/DOS thing. It generally has no meaning under Linux/Unix. If ls on Android provides a help page it's probably ls --help (as it is on a desktop Linux distro). – eldarerathis Jun 26 '13 at 0:05
  • This I have also tried to no avail? – Gigamegs Jun 26 '13 at 0:11
  • It might be helpful to include your phone model / ROM and list the output of busybox ls --help. – Matthew Read Jun 26 '13 at 0:46
4

It sounds like you want the extremely common

ls -l

For reference, the complete busybox help for ls:

BusyBox v1.21.0-Stericson (2013-01-28 21:49:55 GMT) multi-call binary.

Usage: ls [-1AaCxdLHRFplinsehrSXvctu] [-w WIDTH] [FILE]...

List directory contents

        -1      One column output
        -a      Include entries which start with .
        -A      Like -a, but exclude . and ..
        -C      List by columns
        -x      List by lines
        -d      List directory entries instead of contents
        -L      Follow symlinks
        -H      Follow symlinks on command line
        -R      Recurse
        -p      Append / to dir entries
        -F      Append indicator (one of */=@|) to entries
        -l      Long listing format
        -i      List inode numbers
        -n      List numeric UIDs and GIDs instead of names
        -s      List allocated blocks
        -e      List full date and time
        -h      List sizes in human readable format (1K 243M 2G)
        -r      Sort in reverse order
        -S      Sort by size
        -X      Sort by extension
        -v      Sort by version
        -c      With -l: sort by ctime
        -t      With -l: sort by mtime
        -u      With -l: sort by atime
        -w N    Assume the terminal is N columns wide
        --color[={always,never,auto}]   Control coloring
| improve this answer | |
  • Solved! It was 2 ls installed and I deleted the one linked to toolbox. But what is toolbox? – Gigamegs Jun 26 '13 at 8:37
  • Probably it is the phone vendor's custom version of busybox. Or it could be anything. – Michael Hampton Jun 26 '13 at 13:06
2

I would generally not expect /? to provide meaningful output, because it's really a DOS/Windows thing. Linux/Unix command option are typically passed with hyphens, either a single one for short flags (for example, ls -l) or two hyphens for verbose ones (e.g. --help). Two possibilities that you can try:

  1. If you're using a version provided by busybox, you can use busybox ls --help. Doing this without the call to busybox at the front of the command may not yield any results (e.g. CyanogenMod just responds with unknown option '--' if I try ls --help).
  2. The Linux man page for ls is readily available online. The options there are probably not all implemented in the Android binary, but it will give you a bit of an overview. You can also check the man page for busybox, which has all of the commands it implements as well as the options they support. I am not sure if the Android version implements all the same commands/options, but it very well may.
| improve this answer | |
  • I tried with and without busybox to no avail. – Gigamegs Jun 26 '13 at 0:32
  • The help can be omitted from a busybox build. When omitted, you can't get help/usage information from busybox commands. – Michael Hampton Jun 26 '13 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.