• Home
Name Date Size #Lines LOC

..--

Android.bpD03-May-20241.3 KiB7165

OWNERSD03-May-202415 21

README.mdD03-May-202414 KiB314233

README.md

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. The awk added in
22Android P is Brian Kernighan's "one true" awk.
23
24The lists below show what tools were provided and where they came from in
25each release starting with Gingerbread. This doesn't tell the full story,
26because the toolbox implementations did have bugs fixed and options added
27over the years. Gingerbread's rm, for example, supported `-r`/`-R` but not
28`-f`. But this gives you an idea of what was available in any given release,
29and how usable it was likely to be. (**Bold** marks where we switched to toybox
30or first added something to toybox.)
31
32Also note that in any given release `toybox` probably contains more
33commands than there are symlinks for in `/system/bin`. You can get the
34full list for a release by running `toybox` directly.
35
36
37## Android 13 ("T")
38
39BSD: fsck\_msdos newfs\_msdos
40
41bzip2: bzcat bzip2 bunzip2
42
43gavinhoward/bc: bc
44
45one-true-awk: awk
46
47toolbox: getevent getprop setprop start stop
48
49toybox (0.8.6-ish): [ acpi base64 basename blkdiscard blkid blockdev cal cat chattr chcon
50chgrp chmod chown chroot chrt cksum clear cmp comm cp cpio cut date
51dd devmem df diff dirname dmesg dos2unix du echo egrep env expand
52expr fallocate false fgrep file find flock fmt free freeramdisk fsfreeze
53fsync getconf getenforce getfattr getopt grep groups gunzip gzip head
54help hostname hwclock i2cdetect i2cdump i2cget i2cset iconv id ifconfig
55inotifyd insmod install ionice iorenice iotop kill killall ln load\_policy
56log logname losetup ls lsattr lsmod lsof lspci lsusb makedevs md5sum
57microcom mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount
58mountpoint mv nbd-client nc netcat netstat nice nl nohup nproc nsenter
59od partprobe paste patch pgrep pidof ping ping6 pivot\_root pkill pmap
60printenv printf prlimit ps pwd pwdx readelf readlink realpath renice
61restorecon rev rfkill rm rmdir rmmod rtcwake runcon sed sendevent
62seq setenforce setfattr setsid sha1sum sha224sum sha256sum sha384sum
63sha512sum sleep sort split stat strings stty swapoff swapon sync sysctl
64tac tail tar taskset tee test time timeout top touch tr traceroute
65traceroute6 true truncate tty tunctl **uclampset** ulimit umount uname
66uniq unix2dos unlink unshare uptime usleep uudecode uuencode uuidgen
67vconfig vi vmstat watch wc which whoami xargs xxd yes zcat
68
69
70## Android 12 ("S")
71
72BSD: fsck\_msdos newfs\_msdos
73
74bzip2: bzcat bzip2 bunzip2
75
76gavinhoward/bc: bc
77
78one-true-awk: awk
79
80toolbox: getevent getprop setprop start stop
81
82toybox (0.8.4-ish): **[** acpi base64 basename **blkdiscard** blkid blockdev cal cat chattr chcon
83chgrp chmod chown chroot chrt cksum clear cmp comm cp cpio cut date
84dd devmem df diff dirname dmesg dos2unix du echo egrep env expand
85expr fallocate false fgrep file find flock fmt free freeramdisk fsfreeze
86fsync getconf getenforce getfattr getopt grep groups gunzip gzip head
87help hostname hwclock i2cdetect i2cdump i2cget i2cset iconv id ifconfig
88inotifyd insmod install ionice iorenice iotop kill killall ln load\_policy
89log logname losetup ls lsattr lsmod lsof lspci lsusb makedevs md5sum
90microcom mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount
91mountpoint mv nbd-client nc netcat netstat nice nl nohup nproc nsenter
92od partprobe paste patch pgrep pidof ping ping6 pivot\_root pkill pmap
93printenv printf prlimit ps pwd pwdx readelf readlink realpath renice
94restorecon rev rfkill rm rmdir rmmod **rtcwake** runcon sed sendevent
95seq setenforce setfattr setsid sha1sum sha224sum sha256sum sha384sum
96sha512sum sleep sort split stat strings stty swapoff swapon sync sysctl
97tac tail tar taskset tee **test** time timeout top touch tr traceroute
98traceroute6 true truncate tty tunctl ulimit umount uname uniq unix2dos
99unlink unshare uptime usleep uudecode uuencode uuidgen vconfig vi
100vmstat watch wc which whoami xargs xxd yes zcat
101
102
103## Android 11 ("R")
104
105BSD: fsck\_msdos newfs\_msdos
106
107bzip2: bzcat bzip2 bunzip2
108
109gavinhoward/bc: bc
110
111one-true-awk: awk
112
113toolbox: getevent getprop setprop start stop
114
115toybox (0.8.3-ish): acpi base64 basename blkid blockdev cal cat chattr chcon chgrp chmod
116chown chroot chrt cksum clear cmp comm cp cpio cut date dd **devmem**
117df diff dirname dmesg dos2unix du echo egrep env expand expr fallocate
118false fgrep file find flock fmt free freeramdisk fsfreeze **fsync** getconf
119getenforce getfattr **getopt** grep groups gunzip gzip head help hostname
120hwclock i2cdetect i2cdump i2cget i2cset iconv id ifconfig inotifyd
121insmod install ionice iorenice iotop kill killall ln load\_policy log
122logname losetup ls lsattr lsmod lsof lspci lsusb makedevs md5sum microcom
123mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount mountpoint
124mv nbd-client nc netcat netstat nice nl nohup nproc nsenter od partprobe
125paste patch pgrep pidof ping ping6 pivot\_root pkill pmap printenv
126printf prlimit ps pwd pwdx **readelf** readlink realpath renice restorecon
127rev rfkill rm rmdir rmmod runcon sed sendevent seq setenforce setfattr
128setsid sha1sum sha224sum sha256sum sha384sum sha512sum sleep sort
129split stat strings stty swapoff swapon sync sysctl tac tail tar taskset
130tee time timeout top touch tr traceroute traceroute6 true truncate
131tty tunctl ulimit umount uname uniq unix2dos unlink unshare uptime
132usleep uudecode uuencode uuidgen vconfig **vi** vmstat watch wc which
133whoami xargs xxd yes zcat
134
135
136## Android 10 ("Q")
137
138BSD: grep fsck\_msdos newfs\_msdos
139
140bzip2: bzcat bzip2 bunzip2
141
142one-true-awk: awk
143
144toolbox: getevent getprop
145
146toybox (0.8.0-ish): acpi base64 basename **bc** **blkid** blockdev cal cat **chattr** chcon chgrp
147chmod chown chroot chrt cksum clear cmp comm cp cpio cut date dd df
148diff dirname dmesg dos2unix du echo **egrep** env expand expr fallocate
149false **fgrep** file find flock fmt free **freeramdisk** **fsfreeze** **getconf**
150getenforce **getfattr** grep groups gunzip gzip head **help** hostname hwclock
151**i2cdetect** **i2cdump** **i2cget** **i2cset** **iconv** id ifconfig inotifyd insmod
152**install** ionice iorenice **iotop** kill killall ln load\_policy log logname
153losetup ls **lsattr** lsmod lsof lspci lsusb **makedevs** md5sum microcom
154mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount mountpoint
155mv **nbd-client** **nc** **netcat** netstat nice nl nohup **nproc** **nsenter** od **partprobe**
156paste patch pgrep pidof **ping** **ping6** **pivot\_root** pkill pmap printenv
157printf **prlimit** ps pwd **pwdx** readlink realpath renice restorecon **rev**
158**rfkill** rm rmdir rmmod runcon sed sendevent seq setenforce **setfattr**
159setprop setsid sha1sum sha224sum sha256sum sha384sum sha512sum sleep
160sort split start stat stop strings stty swapoff swapon sync sysctl
161tac tail tar taskset tee time timeout top touch tr **traceroute** **traceroute6**
162true truncate tty **tunctl** ulimit umount uname uniq unix2dos **unlink**
163**unshare** uptime usleep uudecode uuencode **uuidgen** **vconfig** vmstat **watch**
164wc which whoami xargs xxd yes zcat
165
166
167## Android 9.0 (Pie)
168
169BSD: dd grep
170
171bzip2: bzcat bzip2 bunzip2
172
173one-true-awk: awk
174
175toolbox: getevent getprop newfs\_msdos
176
177toybox (0.7.6-ish): acpi base64 basename blockdev cal cat chcon chgrp chmod chown
178chroot chrt cksum clear cmp comm cp cpio cut date df diff dirname dmesg
179dos2unix du echo env expand expr fallocate false file find flock **fmt** free
180getenforce groups gunzip gzip head hostname hwclock id ifconfig inotifyd
181insmod ionice iorenice kill killall ln load\_policy log logname losetup ls
182lsmod lsof lspci lsusb md5sum microcom mkdir mkfifo mknod mkswap mktemp
183modinfo modprobe more mount mountpoint mv netstat nice nl nohup od paste
184patch pgrep pidof pkill pmap printenv printf ps pwd readlink realpath
185renice restorecon rm rmdir rmmod runcon sed sendevent seq setenforce
186setprop setsid sha1sum sha224sum sha256sum sha384sum sha512sum sleep
187sort split start stat stop strings **stty** swapoff swapon sync sysctl tac
188tail tar taskset tee time timeout top touch tr true truncate tty ulimit
189umount uname uniq unix2dos uptime usleep uudecode uuencode vmstat wc
190which whoami xargs xxd yes zcat
191
192
193## Android 8.0 (Oreo)
194
195BSD: dd grep
196
197bzip2: bzcat bzip2 bunzip2
198
199toolbox: getevent newfs\_msdos
200
201toybox (0.7.3-ish): acpi base64 basename blockdev cal cat chcon chgrp chmod chown
202chroot chrt cksum clear cmp comm cp cpio cut date df **diff** dirname dmesg
203dos2unix du echo env expand expr fallocate false **file** find flock free
204getenforce getprop groups **gunzip** **gzip** head hostname hwclock id ifconfig
205inotifyd insmod ionice iorenice kill killall ln load\_policy **log** logname
206losetup ls lsmod lsof **lspci** lsusb md5sum **microcom** mkdir **mkfifo** mknod
207mkswap mktemp modinfo **modprobe** more mount mountpoint mv netstat nice
208nl nohup od paste patch pgrep pidof pkill pmap printenv printf **ps** pwd
209readlink realpath renice restorecon rm rmdir rmmod runcon sed **sendevent**
210seq setenforce setprop setsid sha1sum **sha224sum** **sha256sum** **sha384sum**
211**sha512sum** sleep sort split start stat stop strings swapoff swapon sync
212sysctl tac tail tar taskset tee time timeout **top** touch tr true truncate
213tty ulimit umount uname uniq unix2dos uptime usleep **uudecode** **uuencode**
214vmstat wc which whoami xargs xxd yes **zcat**
215
216
217## Android 7.0 (Nougat)
218
219BSD: dd grep
220
221toolbox: getevent iftop ioctl log nandread newfs\_msdos ps prlimit
222sendevent start stop top
223
224toybox (0.7.0-ish): acpi **base64** basename blockdev bzcat cal cat chcon chgrp chmod
225chown chroot cksum clear comm cmp cp cpio cut date **df** dirname dmesg
226dos2unix **du** echo env expand expr fallocate false find **flock** free
227getenforce getprop groups head hostname hwclock id ifconfig inotifyd
228insmod **ionice** **iorenice** kill **killall** load\_policy ln logname losetup **ls**
229lsmod **lsof** lsusb md5sum mkdir mknod mkswap mktemp modinfo more *mount*
230mountpoint mv netstat nice nl nohup od paste patch pgrep pidof pkill
231pmap printenv printf pwd readlink realpath **renice** restorecon rm rmdir
232rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
233split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
234time timeout touch tr true truncate **tty** **ulimit** umount uname uniq unix2dos
235**uptime** usleep vmstat wc which whoami xargs **xxd** yes
236
237
238## Android 6.0 (Marshmallow)
239
240BSD: dd du grep
241
242toolbox: df getevent iftop ioctl ionice log ls lsof mount nandread
243newfs\_msdos ps prlimit renice sendevent start stop top uptime watchprops
244
245toybox (0.5.2-ish): acpi basename blockdev bzcat cal cat chcon chgrp chmod chown
246chroot cksum clear comm cmp cp cpio cut date dirname dmesg dos2unix echo
247env expand expr fallocate false find free getenforce getprop groups
248head hostname hwclock id ifconfig inotifyd insmod kill load\_policy ln
249logname losetup lsmod lsusb md5sum mkdir mknod mkswap mktemp modinfo
250more mountpoint mv netstat nice nl nohup od paste patch pgrep pidof
251pkill pmap printenv printf pwd readlink realpath restorecon rm rmdir
252rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
253split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
254time timeout touch tr true truncate umount uname uniq unix2dos usleep
255vmstat wc which whoami xargs yes
256
257
258## Android 5.0 (Lollipop)
259
260BSD: cat chown cp dd du grep kill ln mv printenv rm rmdir sleep sync
261
262toolbox: chcon chmod clear cmp date df dmesg getenforce getevent getprop
263getsebool hd id ifconfig iftop insmod ioctl ionice load\_policy log ls
264lsmod lsof md5 mkdir mknod mkswap mount nandread netstat newfs\_msdos
265nohup notify ps readlink renice restorecon rmmod route runcon schedtop
266sendevent setenforce setprop setsebool smd start stop swapoff swapon
267top touch umount uptime vmstat watchprops wipe
268
269
270## Android 4.4 (KitKat)
271
272BSD: cat cp dd du grep newfs\_msdos
273
274toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
275getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
276load\_policy log ls lsmod lsof md5 mkdir mkswap mount mv nandread netstat
277notify printenv ps readlink renice restorecon rm rmdir rmmod route runcon
278schedtop sendevent setconsole setenforce setprop setsebool sleep smd start
279stop swapoff swapon sync top touch umount uptime vmstat watchprops wipe
280
281
282## Android 4.1-4.3 (JellyBean)
283
284BSD: cat cp dd du grep newfs\_msdos
285
286toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
287getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
288load\_policy log ls lsmod lsof md5 mkdir mount mv nandread netstat notify
289printenv ps reboot renice restorecon rm rmdir rmmod route runcon schedtop
290sendevent setconsole setenforce setprop setsebool sleep smd start stop
291sync top touch umount uptime vmstat watchprops wipe
292
293
294## Android 4.0 (IceCreamSandwich)
295
296BSD: cat dd newfs\_msdos
297
298toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
299iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
300nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
301schedtop sendevent setconsole setprop sleep smd start stop sync top
302touch umount uptime vmstat watchprops wipe
303
304
305## Android 2.3 (Gingerbread)
306
307BSD: cat dd newfs\_msdos
308
309toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
310iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
311nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
312schedtop sendevent setconsole setprop sleep smd start stop sync top
313umount uptime vmstat watchprops wipe
314