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