• Home
  • History
  • Annotate
  • only in /system/core/shell_and_utilities/
NameDateSize

..10-Aug-20184 KiB

Android.bp10-Aug-2018394

OWNERS10-Aug-201815

README.md10-Aug-20188.1 KiB

README.md

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 unused in the tree up to and including KitKat).
8
9Initially Android had a very limited command-line provided by its own
10"toolbox" binary. Since Marshmallow 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, and continued this work 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
21Not everything is provided by toybox, though. We currently still use
22the BSD dd and grep (because the toybox versions are still unfinished),
23and for the bzip2 command-line tools we use the ones that are part of
24the bzip2 distribution. The awk added in Android P is Brian Kernighan's
25"one true" awk.
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.
33
34Also note that in any given release `toybox` probably contains more
35commands than there are symlinks for in `/system/bin`. You can get the
36full list for a release by running `toybox` directly.
37
38
39Android 2.3 (Gingerbread)
40-------------------------
41
42BSD: cat dd newfs\_msdos
43
44toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
45iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
46nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
47schedtop sendevent setconsole setprop sleep smd start stop sync top
48umount uptime vmstat watchprops wipe
49
50
51Android 4.0 (IceCreamSandwich)
52------------------------------
53
54BSD: cat dd newfs\_msdos
55
56toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
57iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
58nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
59schedtop sendevent setconsole setprop sleep smd start stop sync top
60touch umount uptime vmstat watchprops wipe
61
62
63Android 4.1-4.3 (JellyBean)
64---------------------------
65
66BSD: cat cp dd du grep newfs\_msdos
67
68toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
69getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
70load\_policy log ls lsmod lsof md5 mkdir mount mv nandread netstat notify
71printenv ps reboot renice restorecon rm rmdir rmmod route runcon schedtop
72sendevent setconsole setenforce setprop setsebool sleep smd start stop
73sync top touch umount uptime vmstat watchprops wipe
74
75
76Android 4.4 (KitKat)
77--------------------
78
79BSD: cat cp dd du grep newfs\_msdos
80
81toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
82getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
83load\_policy log ls lsmod lsof md5 mkdir mkswap mount mv nandread netstat
84notify printenv ps readlink renice restorecon rm rmdir rmmod route runcon
85schedtop sendevent setconsole setenforce setprop setsebool sleep smd start
86stop swapoff swapon sync top touch umount uptime vmstat watchprops wipe
87
88
89Android 5.0 (Lollipop)
90----------------------
91
92BSD: cat chown cp dd du grep kill ln mv printenv rm rmdir sleep sync
93
94toolbox: chcon chmod clear cmp date df dmesg getenforce getevent getprop
95getsebool hd id ifconfig iftop insmod ioctl ionice load\_policy log ls
96lsmod lsof md5 mkdir mknod mkswap mount nandread netstat newfs\_msdos
97nohup notify ps readlink renice restorecon rmmod route runcon schedtop
98sendevent setenforce setprop setsebool smd start stop swapoff swapon
99top touch umount uptime vmstat watchprops wipe
100
101
102Android 6.0 (Marshmallow)
103-------------------------
104
105BSD: dd du grep
106
107toolbox: df getevent iftop ioctl ionice log ls lsof mount nandread
108newfs\_msdos ps prlimit renice sendevent start stop top uptime watchprops
109
110toybox: acpi basename blockdev bzcat cal cat chcon chgrp chmod chown
111chroot cksum clear comm cmp cp cpio cut date dirname dmesg dos2unix echo
112env expand expr fallocate false find free getenforce getprop groups
113head hostname hwclock id ifconfig inotifyd insmod kill load\_policy ln
114logname losetup lsmod lsusb md5sum mkdir mknod mkswap mktemp modinfo
115more mountpoint mv netstat nice nl nohup od paste patch pgrep pidof
116pkill pmap printenv printf pwd readlink realpath restorecon rm rmdir
117rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
118split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
119time timeout touch tr true truncate umount uname uniq unix2dos usleep
120vmstat wc which whoami xargs yes
121
122
123Android 7.0 (Nougat)
124--------------------
125
126BSD: dd grep
127
128toolbox: getevent iftop ioctl log nandread newfs\_msdos ps prlimit
129sendevent start stop top
130
131toybox: acpi base64 basename blockdev bzcat cal cat chcon chgrp chmod
132chown chroot cksum clear comm cmp cp cpio cut date df dirname dmesg
133dos2unix du echo env expand expr fallocate false find flock free
134getenforce getprop groups head hostname hwclock id ifconfig inotifyd
135insmod ionice iorenice kill killall load\_policy ln logname losetup ls
136lsmod lsof lsusb md5sum mkdir mknod mkswap mktemp modinfo more mount
137mountpoint mv netstat nice nl nohup od paste patch pgrep pidof pkill
138pmap printenv printf pwd readlink realpath renice restorecon rm rmdir
139rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
140split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
141time timeout touch tr true truncate tty ulimit umount uname uniq unix2dos
142uptime usleep vmstat wc which whoami xargs xxd yes
143
144
145Android 8.0 (Oreo)
146------------------
147
148BSD: dd grep
149
150bzip2: bzcat bzip2 bunzip2
151
152toolbox: getevent newfs\_msdos
153
154toybox: acpi base64 basename blockdev cal cat chcon chgrp chmod chown
155chroot chrt cksum clear cmp comm cp cpio cut date df diff dirname dmesg
156dos2unix du echo env expand expr fallocate false file find flock free
157getenforce getprop groups gunzip gzip head hostname hwclock id ifconfig
158inotifyd insmod ionice iorenice kill killall ln load\_policy log logname
159losetup ls lsmod lsof lspci lsusb md5sum microcom mkdir mkfifo mknod
160mkswap mktemp modinfo modprobe more mount mountpoint mv netstat nice
161nl nohup od paste patch pgrep pidof pkill pmap printenv printf ps pwd
162readlink realpath renice restorecon rm rmdir rmmod runcon sed sendevent
163seq setenforce setprop setsid sha1sum sha224sum sha256sum sha384sum
164sha512sum sleep sort split start stat stop strings swapoff swapon sync
165sysctl tac tail tar taskset tee time timeout top touch tr true truncate
166tty ulimit umount uname uniq unix2dos uptime usleep uudecode uuencode
167vmstat wc which whoami xargs xxd yes zcat
168
169Android P
170---------
171
172BSD: dd grep
173
174bzip2: bzcat bzip2 bunzip2
175
176one-true-awk: awk
177
178toolbox: getevent getprop newfs\_msdos
179
180toybox: acpi base64 basename blockdev cal cat chcon chgrp chmod chown
181chroot chrt cksum clear cmp comm cp cpio cut date df diff dirname dmesg
182dos2unix du echo env expand expr fallocate false file find flock free
183getenforce groups gunzip gzip head hostname hwclock id ifconfig inotifyd
184insmod ionice iorenice kill killall ln load\_policy log logname losetup
185ls lsmod lsof lspci lsusb md5sum microcom mkdir mkfifo mknod mkswap
186mktemp modinfo modprobe more mount mountpoint mv netstat nice nl nohup
187od paste patch pgrep pidof pkill pmap printenv printf ps pwd readlink
188realpath renice restorecon rm rmdir rmmod runcon sed sendevent seq
189setenforce setprop setsid sha1sum sha224sum sha256sum sha384sum
190sha512sum sleep sort split start stat stop strings swapoff swapon sync
191sysctl tac tail tar taskset tee time timeout top touch tr true truncate
192tty ulimit umount uname uniq unix2dos uptime usleep uudecode uuencode
193vmstat wc which whoami xargs xxd yes zcat
194