1Android's shell and utilities
2=============================
3
4Since IceCreamSandwich Android has used
5[mksh](https://www.mirbsd.org/mksh.htm) as its shell. Before then it used
6[ash](https://en.wikipedia.org/wiki/Almquist_shell) (which actually
7remained in the tree up to and including KitKat).
8
9Initially Android had a very limited command-line provided by its
10own "toolbox" binary. These days almost everything is supplied by
11[toybox](http://landley.net/toybox/) instead.
12
13We started moving a few of the more important tools to full
14BSD implementations in JellyBean before we started in earnest in
15Lollipop. Lollipop was a major break with the past in many ways (LP64
16support and the switch to ART both having lots of knock-on effects around
17the system), so although this was the beginning of the end of toolbox it
18(a) didn't stand out given all the other systems-level changes and (b)
19in Marshmallow we changed direction and started the move to toybox.
20
21The lists below show what tools were provided and where they came from in
22each release starting with Gingerbread. This doesn't tell the full story,
23because the toolbox implementations did have bugs fixed and options added
24over the years. Gingerbread's rm, for example, supported `-r`/`-R` but not
25`-f`. But this gives you an idea of what was available in any given release,
26and how usable it was likely to be.
27
28
29Android 2.3 (Gingerbread)
30-------------------------
31
32BSD: cat dd newfs\_msdos
33
34toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
35iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
36nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
37schedtop sendevent setconsole setprop sleep smd start stop sync top
38umount uptime vmstat watchprops wipe
39
40
41Android 4.0 (IceCreamSandwich)
42------------------------------
43
44BSD: cat dd newfs\_msdos
45
46toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
47iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
48nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
49schedtop sendevent setconsole setprop sleep smd start stop sync top
50touch umount uptime vmstat watchprops wipe
51
52
53Android 4.1-4.3 (JellyBean)
54---------------------------
55
56BSD: cat cp dd du grep newfs\_msdos
57
58toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
59getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
60load\_policy log ls lsmod lsof md5 mkdir mount mv nandread netstat notify
61printenv ps reboot renice restorecon rm rmdir rmmod route runcon schedtop
62sendevent setconsole setenforce setprop setsebool sleep smd start stop
63sync top touch umount uptime vmstat watchprops wipe
64
65
66Android 4.4 (KitKat)
67--------------------
68
69BSD: cat cp dd du grep newfs\_msdos
70
71toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
72getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
73load\_policy log ls lsmod lsof md5 mkdir mkswap mount mv nandread netstat
74notify printenv ps readlink renice restorecon rm rmdir rmmod route runcon
75schedtop sendevent setconsole setenforce setprop setsebool sleep smd start
76stop swapoff swapon sync top touch umount uptime vmstat watchprops wipe
77
78
79Android 5.0 (Lollipop)
80----------------------
81
82BSD: cat chown cp dd du grep kill ln mv printenv rm rmdir sleep sync
83
84toolbox: chcon chmod clear cmp date df dmesg getenforce getevent getprop
85getsebool hd id ifconfig iftop insmod ioctl ionice load\_policy log ls
86lsmod lsof md5 mkdir mknod mkswap mount nandread netstat newfs\_msdos
87nohup notify ps readlink renice restorecon rmmod route runcon schedtop
88sendevent setenforce setprop setsebool smd start stop swapoff swapon
89top touch umount uptime vmstat watchprops wipe
90
91
92Android 6.0 (Marshmallow)
93-------------------------
94
95BSD: dd du grep
96
97toolbox: df getevent iftop ioctl ionice log ls lsof mount nandread
98newfs\_msdos ps prlimit renice sendevent start stop top uptime watchprops
99
100toybox: acpi basename blockdev bzcat cal cat chcon chgrp chmod chown
101chroot cksum clear comm cmp cp cpio cut date dirname dmesg dos2unix echo
102env expand expr fallocate false find free getenforce getprop groups
103head hostname hwclock id ifconfig inotifyd insmod kill load\_policy ln
104logname losetup lsmod lsusb md5sum mkdir mknod mkswap mktemp modinfo
105more mountpoint mv netstat nice nl nohup od paste patch pgrep pidof
106pkill pmap printenv printf pwd readlink realpath restorecon rm rmdir
107rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
108split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
109time timeout touch tr true truncate umount uname uniq unix2dos usleep
110vmstat wc which whoami xargs yes
111
112
113Android 7.0 (Nougat)
114--------------------
115
116BSD: dd grep
117
118toolbox: getevent iftop ioctl log nandread newfs\_msdos ps prlimit
119sendevent start stop top
120
121toybox: acpi base64 basename blockdev bzcat cal cat chcon chgrp chmod
122chown chroot cksum clear comm cmp cp cpio cut date df dirname dmesg
123dos2unix du echo env expand expr fallocate false find flock free
124getenforce getprop groups head hostname hwclock id ifconfig inotifyd
125insmod ionice iorenice kill killall load\_policy ln logname losetup ls
126lsmod lsof lsusb md5sum mkdir mknod mkswap mktemp modinfo more mount
127mountpoint mv netstat nice nl nohup od paste patch pgrep pidof pkill
128pmap printenv printf pwd readlink realpath renice restorecon rm rmdir
129rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
130split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
131time timeout touch tr true truncate tty ulimit umount uname uniq unix2dos
132uptime usleep vmstat wc which whoami xargs xxd yes
133
134
135Current AOSP
136------------
137
138BSD: dd grep
139
140bzip2: bzcat bzip2 bunzip2
141
142toolbox: getevent gzip newfs\_msdos gunzip zcat
143
144toybox: acpi base64 basename blockdev cal cat chcon chgrp chmod chown
145chroot chrt cksum clear cmp comm cp cpio cut date df diff dirname dmesg
146dos2unix du echo env expand expr fallocate false file find flock free
147getenforce getprop groups head hostname hwclock id ifconfig inotifyd
148insmod ionice iorenice kill killall ln load\_policy log logname losetup
149ls lsmod lsof lsusb md5sum microcom mkdir mknod mkswap mktemp modinfo
150modprobe more mount mountpoint mv netstat nice nl nohup od paste patch
151pgrep pidof pkill pmap printenv printf ps pwd readlink realpath renice
152restorecon rm rmdir rmmod runcon sed sendevent seq setenforce setprop
153setsid sha1sum sha224sum sha256sum sha384sum sha512sum sleep sort split
154start stat stop strings swapoff swapon sync sysctl tac tail tar taskset
155tee time timeout top touch tr true truncate tty ulimit umount uname uniq
156unix2dos uptime usleep uudecode uuencode vmstat wc which whoami xargs
157xxd yes
158