[REF]Terminal Emulator Commands ! (Android shell command reference)
Android Shell Command Reference Page History
A "shell" is a program that listens to keyboard input from a user and performs actions as directed by the user. Android devices come with a simple shell program. This shell program is mostly undocumented. Since many people are curious about it I thought I'd write up some documentation for it.
Common problems
The built-in shell has very limited error handling. When you type a command name incorrectly it will say "permission denied", even though the real problem is that it couldn't find the command:
Quote:
$ dir |
Quote:
$ ls |
The PATH variable
The Android shell will run any program it finds in its PATH. The PATH is a list of directories. You can find out what your shell's PATH is set to by using the built-in echo command:
Quote:
$ echo $PATH /data/local/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin |
Built in Commands
Every shell has a few built-in commands. Some common built-in commands are:
echo -- prints text to stdout.
set -- sets shell variables
export -- makes shell variables available to command-line programs
cd -- change the current directory.
pwd -- print name of the current directory.
Commands
To find out what commands you have available to you, use the "ls" command on each of the directories in the PATH variable.
Finding documentation for the Android commands.
Many of the Android commands are based on standard Linux (or bsd) commands. If you're curious about a command, you can sometimes learn how it works by using the "man" command on a desktop Linux or OSX (Apple Macintosh) computer. The Linux or OSX version of the command may be different in details, but much of the documentation will still apply to the Android version of the command.
Another source of documentation for people without a Linux or OSX machine handy is to use a web browser and use a web search engine to search for the text: "man Linux command-name".
List of commands
The following is a list of the commands that are present on a Nexus S phone running an Android 2.3.3 "user-debug" build. Many of these commands are not present on a "user" phone. (They are missing from a "user" phone because they are specific to developing or debugging the Android operating system.)
Quote:
$ ls /data/local/bin /data/local/bin: No such file or directory |
Quote:
$ ls /sbin |
The /sbin directory exists, but you don't have permission to access it. You need root access. If you have a developer phone, or otherwise have root access to your phone you can see what's in this directory.
Quote:
$ su # ls /sbin ueventd adbd # exit $ |
Notice also that neither of the /sbin commands are useful to the shell -- the adb and ueventd files are 'daemon' programs used to implement the Android Debugger "adb" program that is used by developers.
Quote:
$ ls /vendor/bin gpsd pvrsrvinit |
Quote:
$ ls /system/sbin /system/sbin: No such file or directory |
Quote:
$ ls /system/bin am |
Quote:
amix aplay |
Quote:
app_process applypatch |
Quote:
arec |
Quote:
audioloop bluetoothd |
Quote:
bmgr |
Quote:
bootanimation |
Quote:
brcm_patchram_plus bugreport cat |
Quote:
chmod |
Quote:
chown |
Quote:
cmp |
Quote:
dalvikvm |
Quote:
date |
Quote:
dbus-daemon dd |
Quote:
debuggerd dexopt df |
Quote:
dhcpcd dmesg dnsmasq dumpstate dumpsys dvz fsck_msdos gdbserver getevent getprop gzip hciattach hd id ifconfig |
Quote:
iftop |
Quote:
ime input insmod installd ioctl ionice iptables |
Quote:
keystore keystore_cli kill |
Quote:
linker ln |
Quote:
log logcat |
Quote:
logwrapper ls |
Quote:
lsmod lsof make_ext4fs mediaserver mkdir |
Quote:
monkey |
Quote:
mount mtpd mv |
Quote:
nandread ndc netcfg netd netstat newfs_msdos notify omx_tests pand ping pm pppd printenv ps |
Quote:
qemu-props qemud racoon radiooptions reboot |
Quote:
record renice rild rm |
Quote:
rmdir |
Quote:
rmmod route rtp_test run-as schedtest schedtop sdcard sdptool sendevent service servicemanager setconsole setprop setup_fs sh showlease sleep smd stagefright start |
Quote:
stop |
Quote:
surfaceflinger svc sync system_server tc testid3 toolbox top |
Quote:
umount uptime |
Quote:
vdc vmstat vold watchprops wipe wpa_cli wpa_supplicant $ ls /system/xbin add-property-tag btool check-lost+found dexdump dhdutil hcidump latencytop librank opcontrol oprofiled procmem procrank rawbu scp |
Quote:
showmap showslab sqlite3 |
Quote:
strace |
Quote:
su |