Toybox is a free and open-source software implementation of over 200 Unix command line utilities. The Toybox project was started in 2006, and became a 0BSD licensed BusyBox alternative. Toybox is used for most of Android's command-line tools in all currently supported Android versions, and is also used to build Android on Linux and macOS. All of the tools are tested on Linux, and many of them also work on BSD and macOS.

Toybox aims to provide a BSD licensed replacement for the GPL licensed BusyBox. Toybox's major technical design goals are simplicity, smallness, speed and standard compliance. Toybox aims to be mostly POSIX-2008 and LSB 4.1 compatible, and does not focus on having every option found in GNU counterparts.

Toybox is licensed using the permissive 0BSD license, where BusyBox uses the copyleft GNU General Public License, which led to different usage domains. BusyBox is mostly used in the copyleft FOSS domain, while Toybox is used mostly with permissive licensed projects and by commercial companies, e.g. Google's Android, which is an explicit target of Toybox.celf-2015.txt by Rob Landley (2015)

History Toybox was started in early 2006 by Rob Landley after he ended his BusyBox maintainership due to a dispute with Bruce Perens, the original creator of BusyBox.

In 2008, the project went dormant until the end of 2011. Rob Landley resumed work on Toybox, starting with relicensing from the GPL-2.0-only license to the BSD-2-Clause licenseToybox relaunch on toybox.landley.narkive.com (2011-11-20)Switch to 2-clause BSD license (with caveat about scripts directory). 0.2.0 by landley on 15 Nov 2011 with the goal of superseding the Android command line implementation.

At the beginning of 2012, Sony employee Tim Bird suggested creating a permissively licensed alternative to BusyBox. In March 2013, the project was relicensed to an even more permissive 0BSD license.Simplify license text, as mentioned on the mailing list. by Landley (14 Mar 2013)

At the end of 2014, Toybox was integrated into the Android 6.0.x "Marshmallow" development branches for use on devices.Android gets a toybox on lwn.net by Jake Edge (January 14, 2015)toybox on android.googlesource.com (2014-12-28)Issue 76861: Importing parts of Toybox into Android, including dos2unix, unix2dos, sort, uniq, and usleep In 2018, a host Toybox prebuilt was added to AOSP to help make the Android build itself more hermetic.

Controversy In January 2012 the proposal of creating a BSD license alternative to the GPL licensed BusyBox project drew harsh criticism from Matthew Garrett for taking away the only relevant tool for copyright enforcement of the Software Freedom Conservancy group. Rob Landley, who had started the BusyBox-based lawsuits, responded that this was intentional, explaining that the lawsuits had not benefited the project but that they had led to corporate avoidance, expressing a desire to stop the lawsuits "in whatever way I see fit".

Project progress The official Toybox documentation lists an overview of the available, partially available, and missing commands.Toybox Status As of September 2024, Version 0.8.11 achieves approximately 80% of the project's implementation goals targeted for 1.0.Project progress for 0.8.7

List of Toybox Commands acpi — Show status of power sources and thermal devices. adduser, addgroup — Add a user or group to the system. ar — Create, modify, and extract from archives. arch — Print machine (hardware) name, same as uname -m. arp — The Address Resolution Protocol (ARP) arping — Send ARP REQUEST to a neighbour host ascii — Display ASCII character set. at — Execute commands at a later time. awk — pattern scanning and processing language. base32 — Encode or decode in base32. base64 — Encode or decode in base64. basename — Return non-directory portion of a pathname removing suffix. bc — Arbitrary-precision arithmetic language. blkdiscard — Discard device sectors. blkid — Print type, label and UUID of filesystem on a block device or image. — Call ioctls on each listed block device. bunzip2 — Decompress bzip2 files. — Decompress bzip2 files to stdout. cal — Print a calendar. cat — Copy (concatenate) files to stdout. cd — Change the working directory. chattr — Change file attributes on a Linux file system. chgrp — Change group of one or more files. chmod — Change mode of listed files. chown — Change owner of one or more files. chroot — Run command within a new root directory. chrt — Get/set a process' real-time scheduling policy and priority. chsh — Change your login shell. — Change to virtual terminal number N. cksum — For each file, output CRC-32 checksum value, length and name of file. clear — Clear the screen. cmp — Compare the contents of two files. comm — Select or reject lines common to two files. count — Copy stdin to stdout, displaying simple progress indicator to stderr. cp — Copy files. cpio — Copy files into and out of a "newc" format cpio archive. crc32 — Output CRC-32 checksum for each file. cut — Print selected parts of lines from each FILE to standard output. dd — Convert and copy a file. date — Set/get the current date/time. devmem — Read/write physical address via /dev/mem. df — Shows total/used/available disk space for each filesystem listed on the command line, or all currently mounted filesystems. diff - Compare two files. dirname — Show directory portion of path. dmesg — Print or control the kernel ring buffer. dnsdomainname — Show domain this system belongs to (same as hostname -d). dos2unix — Convert newline format from dos "\r\n" to unix "\n". du — Show disk usage, space consumed by files and directories. echo — Write each argument to stdout, with one space between each, followed by a newline. egrep — Show lines matching extended regular expressions. eject — Eject DEVICE or default /dev/cdrom. env — Set the environment for command invocation, or list environment variables. expand — Expand tabs to spaces according to tabstops. factor — Factor integers. fallocate — Tell the filesystem to allocate space for a file. false — Return nonzero. fdisk — Manipulate disk partition table. fgrep — Show lines matching regular expressions. file — Examine the given files and describe their content types. find — Search directories for matching files. flock — Manage advisory file locks. fold — Filter for folding lines. fmt — Reformat input to wordwrap at a given line length, preserving existing indentation level, writing to stdout. free — Display the total, free and used amount of physical memory and swap space. freeramdisk — Free all memory allocated to specified ramdisk. — Freeze or unfreeze a filesystem. — Print type of filesystem on a block device or image. fsync — Synchronize a file's in-core state with storage device. ftpget — Use File Transfer Protocol (FTP) to get a file from an FTP server. ftpput — Use File Transfer Protocol (FTP) to put a file to an FTP server. getconf — Get system configuration values. getopt — Parse command line options and parameters. grep — Show lines matching regular expressions. groups — Print the groups a user is in. gunzip — Decompress gz files. halt — Restart, halt or powerdown the system. head — Copy first lines from files to stdout. help — Show usage information for toybox commands. hexedit — Hexadecimal file editor. hostname — Get/set the current hostname. — Get/set the hardware clock. i2cdetect — Detect i2c devices. i2cdump — Dump i2c registers. i2cget — Read an i2c register. i2cset — Write an i2c register. iconv — Convert character encoding of files. id — Print user and group ID. ifconfig — Display or configure network interface. — Run a program when a filesystem event occurs. insmod — Load the module named MODULE passing options if given. install — Copy files and set attributes. ionice — Change the I/O scheduling priority of a process. — Display or change I/O priority of existing process. iotop — Rank processes by I/O. kill — Send signal to process. killall — Send a signal (default: TERM) to all processes with the given names. killall5 — Send a signal to all processes outside current session. less — opposite of more link — Create hardlink to a file. ln — Create a link between FROM and TO. logger — Log message (or stdin) to syslog. login — Log in as a user, prompting for username and password if necessary. logname — Print the current user name. losetup — Associate a loopback device with a file, or show current file (if any) associated with a loop device. ls — List files. lsattr — List file attributes on a Linux file system. lsmod — Display the currently loaded modules, their sizes and their dependencies. lspci — List PCI devices. lsusb — List USB hosts/devices. — Create a range of special files as specified in a device table. mcookie — Generate a 128-bit strong random number. md5sum — Calculate md5 hash for each input file, reading from stdin if none. memeater — Internally allocate and use memory. microcom — Simple serial console. mix — List OSS sound channels (module snd-mixer-oss), or set volumes. mkdir — Create one or more directories. mkfifo — Create FIFOs (named pipes). mknod — Create a special file NAME with a given type. mkpasswd — Crypt PASSWORD using crypt(3). mkswap — Set up a Linux swap area on a device or file. mktemp — Safely create a new file "DIR/TEMPLATE" and print its name. modinfo — Display module fields for modules specified by name or .ko path. mount — Mount new filesystems on directories. mountpoint — Check whether the directory or device is a mountpoint. mv — Move files. nbd-client — Connect to an NBD server. nc/netcat — Forward stdin/stdout to a file or network connection. netstat — Display networking information. nice — Run a command line at an increased or decreased scheduling priority. nl — Number lines of input. nohup — Run a command that survives the end of its terminal. nproc — Print number of processors. — Run COMMAND in an existing (set of) namespaces. od — Dump data in octal/hex. oneit — Simple init program that runs a single supplied command line partprobe — Tell the kernel about partition table changes. passwd — Update user's authentication tokens. paste — Merge corresponding lines from each input file. patch — Apply a unified diff to one or more files. pgrep — Search for process(es). — Print the PIDs of all processes with the given names. ping — Check network connectivity by sending packets to a host and reporting its response. pivot root — Swap OLD and NEW filesystems (as if by simultaneous mount—move), and move all processes with chdir or chroot under OLD into NEW (including kernel threads) so OLD may be unmounted. pkill — look up or signal processes based on name and other pmap — Report the memory map of a process or processes. poweroff — Restart, halt or powerdown the system. printenv — Print environment variables. printf — Format and print ARGUMENT according to FORMAT, using C printf syntax. prlimit — Print or set resource limits for process number PID. ps — List processes. pwd — Print working (current) directory. pwdx — Print working directory of processes listed on command line. readahead — Preload files into disk cache. readlink — Show what symlink points to. realpath — Display the canonical absolute pathname reboot — Restart, halt or powerdown the system. renice — set nice values of running processes reset — Reset the terminal. rev — Output each line reversed, when no files are given stdin is used. rfkill — Enable/disable wireless devices. rm — Remove each argument from the filesystem. rmdir — Remove one or more directories. rmmod — Unload the module named MODULE from the Linux kernel. rtcwake — Enter the given sleep state until the given time. sed — Stream editor. seq — Count from first to last, by increment. setfattr — Write POSIX extended attributes. setsid — Run process in a new session.