简体   繁体   中英

How to execute the "help" Linux command on Android?

I would like to run a command like am -help and get usage information for that command. However, the -help parameter does not seem to work on the Process Runtime. How to make this work?

cmd1[0] = "/system/bin/sh";
cmd1[1] = "-c";
cmd1[2] = "/system/bin/am -help"  //I want to do sth like this
Process process = Runtime.getRuntime().exec(cmd1);

The command works without the -help . Is there any way of getting Android Shell commmands' usage information and/or syntaxes? Note that if I don't send am -help and just send the command am then it automatically returns usage information for that command. Is there any way to invoke that response in any other way?

#!/system/bin/sh
curl -s http://man.he.net/?topic=$1\&section=all | tail -n +10 | head -n -9

save this in xbin (lets call it hlp.sh) then just hlp.sh cat , you will have help documentation for cat .. you just need install curl first & also need internet connection ..

I hope I haven't misunderstood what it is you are trying to do. But have you heard of the man command? For example if you wanted to run gparted you could enter man gparted and get the documentation on the program. --help is not as thorough as the information you'll find in a man page.

You do not need to root to use the man command.

EDIT : My bad. https://android.stackexchange.com/questions/2149/where-can-i-find-documentation-for-shell-commands I don't think you can use the man command on Android. That sucks. Check that link though, there are some interesting answers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM