1# Android's shell and utilities
2
3Since IceCreamSandwich Android has used
4[mksh](https://www.mirbsd.org/mksh.htm) as its shell. Before then it used
5[ash](https://en.wikipedia.org/wiki/Almquist_shell) (which actually
6remained unused in the tree up to and including KitKat).
7
8Initially Android had a very limited command-line provided by its own
9"toolbox" binary. Since Marshmallow almost everything is supplied by
10[toybox](http://landley.net/toybox/) instead.
11
12We started moving a few of the more important tools to full
13BSD implementations in JellyBean, and continued this work in
14Lollipop. Lollipop was a major break with the past in many ways (LP64
15support and the switch to ART both having lots of knock-on effects around
16the system), so although this was the beginning of the end of toolbox it
17(a) didn't stand out given all the other systems-level changes and (b)
18in Marshmallow we changed direction and started the move to toybox.
19
20Not everything is provided by toybox, though. For the bzip2 command-line tools
21we use the ones that are part of the bzip2 distribution.
22The awk added in Android P is the
23["one true" awk](https://github.com/onetrueawk/awk).
24The bc added in Android Q is
25[Gavin Howard's bc](https://github.com/gavinhoward/bc).
26
27The lists below show what tools were provided and where they came from in
28each release starting with Gingerbread. This doesn't tell the full story,
29because the toolbox implementations did have bugs fixed and options added
30over the years. Gingerbread's rm, for example, supported `-r`/`-R` but not
31`-f`. But this gives you an idea of what was available in any given release,
32and how usable it was likely to be. (**Bold** marks where we switched to toybox
33or first added something to toybox.)
34
35Also note that in any given release `toybox` probably contains more
36commands than there are symlinks for in `/system/bin`. You can get the
37full list for a release by running `toybox` directly.
38
39
40## Android 14 ("U")
41
42BSD: fsck\_msdos newfs\_msdos
43
44bzip2: bzcat bzip2 bunzip2
45
46gavinhoward/bc: bc
47
48one-true-awk: awk
49
50toolbox: getevent getprop setprop start stop
51
52toybox ([0.8.9](http://landley.net/toybox/#10-01-2023)-ish):
53[ acpi base64 basename blkdiscard blkid blockdev **brctl** cal cat chattr
54chcon chgrp chmod chown chroot chrt cksum clear cmp comm cp cpio cut
55date dd devmem df diff dirname dmesg dos2unix du echo egrep env expand
56expr fallocate false fgrep file find flock fmt free freeramdisk fsfreeze
57fsync getconf getenforce getfattr getopt grep groups gunzip gzip head
58help hostname hwclock i2cdetect i2cdump i2cget i2cset iconv id ifconfig
59inotifyd insmod install ionice iorenice iotop kill killall ln load\_policy
60log **logger** logname losetup ls lsattr lsmod lsof lspci lsusb makedevs
61md5sum microcom mkdir mkfifo mknod mkswap mktemp modinfo modprobe
62more mount mountpoint mv nbd-client nc netcat netstat nice nl nohup
63nproc nsenter od partprobe paste patch pgrep pidof ping ping6 pivot\_root
64pkill pmap printenv printf prlimit ps pwd pwdx readelf readlink realpath
65renice restorecon rev rfkill rm rmdir rmmod rtcwake runcon sed sendevent
66seq setenforce setfattr setsid sha1sum sha224sum sha256sum sha384sum
67sha512sum sleep sort split stat strings stty swapoff swapon sync sysctl
68tac tail tar taskset tee test time timeout top touch tr traceroute
69traceroute6 true truncate tty tunctl uclampset ulimit umount uname
70uniq unix2dos unlink unshare uptime usleep uudecode uuencode uuidgen
71vconfig vi vmstat watch wc which whoami xargs xxd yes zcat
72
73
74## Android 13 ("T")
75
76BSD: fsck\_msdos newfs\_msdos
77
78bzip2: bzcat bzip2 bunzip2
79
80gavinhoward/bc: bc
81
82one-true-awk: awk
83
84toolbox: getevent getprop setprop start stop
85
86toybox ([0.8.6](http://landley.net/toybox/#30-11-2021)-ish):
87[ acpi base64 basename blkdiscard blkid blockdev cal cat chattr chcon
88chgrp chmod chown chroot chrt cksum clear cmp comm cp cpio cut date
89dd devmem df diff dirname dmesg dos2unix du echo egrep env expand
90expr fallocate false fgrep file find flock fmt free freeramdisk fsfreeze
91fsync getconf getenforce getfattr getopt grep groups gunzip gzip head
92help hostname hwclock i2cdetect i2cdump i2cget i2cset iconv id ifconfig
93inotifyd insmod install ionice iorenice iotop kill killall ln load\_policy
94log logname losetup ls lsattr lsmod lsof lspci lsusb makedevs md5sum
95microcom mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount
96mountpoint mv nbd-client nc netcat netstat nice nl nohup nproc nsenter
97od partprobe paste patch pgrep pidof ping ping6 pivot\_root pkill pmap
98printenv printf prlimit ps pwd pwdx readelf readlink realpath renice
99restorecon rev rfkill rm rmdir rmmod rtcwake runcon sed sendevent
100seq setenforce setfattr setsid sha1sum sha224sum sha256sum sha384sum
101sha512sum sleep sort split stat strings stty swapoff swapon sync sysctl
102tac tail tar taskset tee test time timeout top touch tr traceroute
103traceroute6 true truncate tty tunctl **uclampset** ulimit umount uname
104uniq unix2dos unlink unshare uptime usleep uudecode uuencode uuidgen
105vconfig vi vmstat watch wc which whoami xargs xxd yes zcat
106
107
108## Android 12 ("S")
109
110BSD: fsck\_msdos newfs\_msdos
111
112bzip2: bzcat bzip2 bunzip2
113
114gavinhoward/bc: bc
115
116one-true-awk: awk
117
118toolbox: getevent getprop setprop start stop
119
120toybox ([0.8.4](http://landley.net/toybox/#24-10-2020)-ish):
121**[** acpi base64 basename **blkdiscard** blkid blockdev cal cat chattr chcon
122chgrp chmod chown chroot chrt cksum clear cmp comm cp cpio cut date
123dd devmem df diff dirname dmesg dos2unix du echo egrep env expand
124expr fallocate false fgrep file find flock fmt free freeramdisk fsfreeze
125fsync getconf getenforce getfattr getopt grep groups gunzip gzip head
126help hostname hwclock i2cdetect i2cdump i2cget i2cset iconv id ifconfig
127inotifyd insmod install ionice iorenice iotop kill killall ln load\_policy
128log logname losetup ls lsattr lsmod lsof lspci lsusb makedevs md5sum
129microcom mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount
130mountpoint mv nbd-client nc netcat netstat nice nl nohup nproc nsenter
131od partprobe paste patch pgrep pidof ping ping6 pivot\_root pkill pmap
132printenv printf prlimit ps pwd pwdx readelf readlink realpath renice
133restorecon rev rfkill rm rmdir rmmod **rtcwake** runcon sed sendevent
134seq setenforce setfattr setsid sha1sum sha224sum sha256sum sha384sum
135sha512sum sleep sort split stat strings stty swapoff swapon sync sysctl
136tac tail tar taskset tee **test** time timeout top touch tr traceroute
137traceroute6 true truncate tty tunctl ulimit umount uname uniq unix2dos
138unlink unshare uptime usleep uudecode uuencode uuidgen vconfig vi
139vmstat watch wc which whoami xargs xxd yes zcat
140
141
142## Android 11 ("R")
143
144BSD: fsck\_msdos newfs\_msdos
145
146bzip2: bzcat bzip2 bunzip2
147
148gavinhoward/bc: bc
149
150one-true-awk: awk
151
152toolbox: getevent getprop setprop start stop
153
154toybox ([0.8.3](http://landley.net/toybox/#11-05-2020)-ish):
155acpi base64 basename blkid blockdev cal cat chattr chcon chgrp chmod
156chown chroot chrt cksum clear cmp comm cp cpio cut date dd **devmem**
157df diff dirname dmesg dos2unix du echo egrep env expand expr fallocate
158false fgrep file find flock fmt free freeramdisk fsfreeze **fsync** getconf
159getenforce getfattr **getopt** grep groups gunzip gzip head help hostname
160hwclock i2cdetect i2cdump i2cget i2cset iconv id ifconfig inotifyd
161insmod install ionice iorenice iotop kill killall ln load\_policy log
162logname losetup ls lsattr lsmod lsof lspci lsusb makedevs md5sum microcom
163mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount mountpoint
164mv nbd-client nc netcat netstat nice nl nohup nproc nsenter od partprobe
165paste patch pgrep pidof ping ping6 pivot\_root pkill pmap printenv
166printf prlimit ps pwd pwdx **readelf** readlink realpath renice restorecon
167rev rfkill rm rmdir rmmod runcon sed sendevent seq setenforce setfattr
168setsid sha1sum sha224sum sha256sum sha384sum sha512sum sleep sort
169split stat strings stty swapoff swapon sync sysctl tac tail tar taskset
170tee time timeout top touch tr traceroute traceroute6 true truncate
171tty tunctl ulimit umount uname uniq unix2dos unlink unshare uptime
172usleep uudecode uuencode uuidgen vconfig **vi** vmstat watch wc which
173whoami xargs xxd yes zcat
174
175
176## Android 10 ("Q")
177
178BSD: grep fsck\_msdos newfs\_msdos
179
180bzip2: bzcat bzip2 bunzip2
181
182one-true-awk: awk
183
184toolbox: getevent getprop
185
186toybox ([0.8.0](http://landley.net/toybox/#08-02-2019)-ish):
187acpi base64 basename **bc** **blkid** blockdev cal cat **chattr** chcon chgrp
188chmod chown chroot chrt cksum clear cmp comm cp cpio cut date dd df
189diff dirname dmesg dos2unix du echo **egrep** env expand expr fallocate
190false **fgrep** file find flock fmt free **freeramdisk** **fsfreeze** **getconf**
191getenforce **getfattr** grep groups gunzip gzip head **help** hostname hwclock
192**i2cdetect** **i2cdump** **i2cget** **i2cset** **iconv** id ifconfig inotifyd insmod
193**install** ionice iorenice **iotop** kill killall ln load\_policy log logname
194losetup ls **lsattr** lsmod lsof lspci lsusb **makedevs** md5sum microcom
195mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount mountpoint
196mv **nbd-client** **nc** **netcat** netstat nice nl nohup **nproc** **nsenter** od **partprobe**
197paste patch pgrep pidof **ping** **ping6** **pivot\_root** pkill pmap printenv
198printf **prlimit** ps pwd **pwdx** readlink realpath renice restorecon **rev**
199**rfkill** rm rmdir rmmod runcon sed sendevent seq setenforce **setfattr**
200setprop setsid sha1sum sha224sum sha256sum sha384sum sha512sum sleep
201sort split start stat stop strings stty swapoff swapon sync sysctl
202tac tail tar taskset tee time timeout top touch tr **traceroute** **traceroute6**
203true truncate tty **tunctl** ulimit umount uname uniq unix2dos **unlink**
204**unshare** uptime usleep uudecode uuencode **uuidgen** **vconfig** vmstat **watch**
205wc which whoami xargs xxd yes zcat
206
207
208## Android 9.0 (Pie)
209
210BSD: dd grep
211
212bzip2: bzcat bzip2 bunzip2
213
214one-true-awk: awk
215
216toolbox: getevent getprop newfs\_msdos
217
218toybox ([0.7.6](http://landley.net/toybox/#24-02-2018)-ish):
219acpi base64 basename blockdev cal cat chcon chgrp chmod chown
220chroot chrt cksum clear cmp comm cp cpio cut date df diff dirname dmesg
221dos2unix du echo env expand expr fallocate false file find flock **fmt** free
222getenforce groups gunzip gzip head hostname hwclock id ifconfig inotifyd
223insmod ionice iorenice kill killall ln load\_policy log logname losetup ls
224lsmod lsof lspci lsusb md5sum microcom mkdir mkfifo mknod mkswap mktemp
225modinfo modprobe more mount mountpoint mv netstat nice nl nohup od paste
226patch pgrep pidof pkill pmap printenv printf ps pwd readlink realpath
227renice restorecon rm rmdir rmmod runcon sed sendevent seq setenforce
228setprop setsid sha1sum sha224sum sha256sum sha384sum sha512sum sleep
229sort split start stat stop strings **stty** swapoff swapon sync sysctl tac
230tail tar taskset tee time timeout top touch tr true truncate tty ulimit
231umount uname uniq unix2dos uptime usleep uudecode uuencode vmstat wc
232which whoami xargs xxd yes zcat
233
234
235## Android 8.0 (Oreo)
236
237BSD: dd grep
238
239bzip2: bzcat bzip2 bunzip2
240
241toolbox: getevent newfs\_msdos
242
243toybox ([0.7.3](http://landley.net/toybox/#21-02-2017)-ish):
244acpi base64 basename blockdev cal cat chcon chgrp chmod chown
245chroot chrt cksum clear cmp comm cp cpio cut date df **diff** dirname dmesg
246dos2unix du echo env expand expr fallocate false **file** find flock free
247getenforce getprop groups **gunzip** **gzip** head hostname hwclock id ifconfig
248inotifyd insmod ionice iorenice kill killall ln load\_policy **log** logname
249losetup ls lsmod lsof **lspci** lsusb md5sum **microcom** mkdir **mkfifo** mknod
250mkswap mktemp modinfo **modprobe** more mount mountpoint mv netstat nice
251nl nohup od paste patch pgrep pidof pkill pmap printenv printf **ps** pwd
252readlink realpath renice restorecon rm rmdir rmmod runcon sed **sendevent**
253seq setenforce setprop setsid sha1sum **sha224sum** **sha256sum** **sha384sum**
254**sha512sum** sleep sort split start stat stop strings swapoff swapon sync
255sysctl tac tail tar taskset tee time timeout **top** touch tr true truncate
256tty ulimit umount uname uniq unix2dos uptime usleep **uudecode** **uuencode**
257vmstat wc which whoami xargs xxd yes **zcat**
258
259
260## Android 7.0 (Nougat)
261
262BSD: dd grep
263
264toolbox: getevent iftop ioctl log nandread newfs\_msdos ps prlimit
265sendevent start stop top
266
267toybox ([0.7.0](http://landley.net/toybox/#02-02-2016)-ish):
268acpi **base64** basename blockdev bzcat cal cat chcon chgrp chmod
269chown chroot cksum clear comm cmp cp cpio cut date **df** dirname dmesg
270dos2unix **du** echo env expand expr fallocate false find **flock** free
271getenforce getprop groups head hostname hwclock id ifconfig inotifyd
272insmod **ionice** **iorenice** kill **killall** load\_policy ln logname losetup **ls**
273lsmod **lsof** lsusb md5sum mkdir mknod mkswap mktemp modinfo more *mount*
274mountpoint mv netstat nice nl nohup od paste patch pgrep pidof pkill
275pmap printenv printf pwd readlink realpath **renice** restorecon rm rmdir
276rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
277split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
278time timeout touch tr true truncate **tty** **ulimit** umount uname uniq unix2dos
279**uptime** usleep vmstat wc which whoami xargs **xxd** yes
280
281
282## Android 6.0 (Marshmallow)
283
284BSD: dd du grep
285
286toolbox: df getevent iftop ioctl ionice log ls lsof mount nandread
287newfs\_msdos ps prlimit renice sendevent start stop top uptime watchprops
288
289toybox ([0.5.2](http://landley.net/toybox/#25-02-2015)-ish):
290acpi basename blockdev bzcat cal cat chcon chgrp chmod chown
291chroot cksum clear comm cmp cp cpio cut date dirname dmesg dos2unix echo
292env expand expr fallocate false find free getenforce getprop groups
293head hostname hwclock id ifconfig inotifyd insmod kill load\_policy ln
294logname losetup lsmod lsusb md5sum mkdir mknod mkswap mktemp modinfo
295more mountpoint mv netstat nice nl nohup od paste patch pgrep pidof
296pkill pmap printenv printf pwd readlink realpath restorecon rm rmdir
297rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
298split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
299time timeout touch tr true truncate umount uname uniq unix2dos usleep
300vmstat wc which whoami xargs yes
301
302
303## Android 5.0 (Lollipop)
304
305BSD: cat chown cp dd du grep kill ln mv printenv rm rmdir sleep sync
306
307toolbox: chcon chmod clear cmp date df dmesg getenforce getevent getprop
308getsebool hd id ifconfig iftop insmod ioctl ionice load\_policy log ls
309lsmod lsof md5 mkdir mknod mkswap mount nandread netstat newfs\_msdos
310nohup notify ps readlink renice restorecon rmmod route runcon schedtop
311sendevent setenforce setprop setsebool smd start stop swapoff swapon
312top touch umount uptime vmstat watchprops wipe
313
314
315## Android 4.4 (KitKat)
316
317BSD: cat cp dd du grep newfs\_msdos
318
319toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
320getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
321load\_policy log ls lsmod lsof md5 mkdir mkswap mount mv nandread netstat
322notify printenv ps readlink renice restorecon rm rmdir rmmod route runcon
323schedtop sendevent setconsole setenforce setprop setsebool sleep smd start
324stop swapoff swapon sync top touch umount uptime vmstat watchprops wipe
325
326
327## Android 4.1-4.3 (JellyBean)
328
329BSD: cat cp dd du grep newfs\_msdos
330
331toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
332getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
333load\_policy log ls lsmod lsof md5 mkdir mount mv nandread netstat notify
334printenv ps reboot renice restorecon rm rmdir rmmod route runcon schedtop
335sendevent setconsole setenforce setprop setsebool sleep smd start stop
336sync top touch umount uptime vmstat watchprops wipe
337
338
339## Android 4.0 (IceCreamSandwich)
340
341BSD: cat dd newfs\_msdos
342
343toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
344iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
345nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
346schedtop sendevent setconsole setprop sleep smd start stop sync top
347touch umount uptime vmstat watchprops wipe
348
349
350## Android 2.3 (Gingerbread)
351
352BSD: cat dd newfs\_msdos
353
354toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
355iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
356nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
357schedtop sendevent setconsole setprop sleep smd start stop sync top
358umount uptime vmstat watchprops wipe
359