BUSYBOX(1)

πŸ“¦ version 1.35.0, in epel 9

🌈 BUSYBOX(1) 🌈

manual name: busybox πŸ’…

✨ NAME ✨

BusyBox β€” The Swiss Army Knife of Embedded Linux

πŸ› οΈ SYNTAX πŸ› οΈ

busybox <applet> [arguments...]  # or

<applet> [arguments...]          # if symlinked

πŸ’– DESCRIPTION πŸ’–

Okay so BusyBox? It's literally a bunch of tiny versions of common UNIX utilities packed into one small executable. Iconic. It's your minimalist replacement for most of the stuff you'd usually find in GNU coreutils, util-linux, etc. Fr fr, the utilities in BusyBox generally have fewer options than their full-featured GNU cousins β€” but the options that do make the cut provide the expected functionality and behave very much like their GNU counterparts. πŸ’…

It was written with size-optimization and limited resources in mind β€” no cap. It's also extremely modular, so you can easily include or exclude commands (or features) at compile time. I'm obsessed because that makes customizing your embedded systems easy-peasy. To create a working system, just add /dev, /etc, and a Linux kernel. BusyBox gives you a fairly complete POSIX environment for any small or embedded system. πŸ¦‹

BusyBox is extremely configurable. That means you can include only the components you need, which reduces binary size. Run make config or make menuconfig to pick the functionality you want to enable. Then run make to compile BusyBox using your configuration. Periodt. ✨

After the compile finishes, use make install to install BusyBox. This installs the bin/busybox binary in the target directory specified by CONFIG_PREFIX. You can set CONFIG_PREFIX when configuring BusyBox, or specify an alternative location at install time (i.e., with a command line like make CONFIG_PREFIX=/tmp/foo install). If you enabled any applet installation scheme (either as symlinks or hardlinks), those will also be installed in the location pointed to by CONFIG_PREFIX. πŸŽ€

🌸 USAGE 🌸

BusyBox is a multi-call binary. A multi-call binary is an executable program that does the same job as more than one utility program. That means there's just a single BusyBox binary, but that single binary acts like a large number of utilities. This lets BusyBox be smaller since all the built-in utility programs (we call them applets) can share code for lots of common operations. πŸ‘‘

You can also invoke BusyBox by issuing a command as an argument on the command line. For example, entering

/bin/busybox ls

will also cause BusyBox to behave as ls. πŸ’…

Of course, adding /bin/busybox into every command would be painful. So most people invoke BusyBox using links to the BusyBox binary. For example, entering

ln -s /bin/busybox ls
./ls

will cause BusyBox to behave as ls (if the ls command has been compiled into BusyBox). Generally speaking, you should never need to make all these links yourself, as the BusyBox build system will do this for you when you run the make install command. 🌈

If you invoke BusyBox with no arguments, it will provide you with a list of the applets that have been compiled into your BusyBox binary. iykyk ✨

πŸ’« COMMON OPTIONS πŸ’«

Most BusyBox applets support the --help argument to provide a terse runtime description of their behavior β€” it's giving helpful main character energy. If the CONFIG_FEATURE_VERBOSE_USAGE option has been enabled, more detailed usage information will also be available. 🫢

πŸ‘‘ COMMANDS πŸ‘‘

Currently available applets include:

[, [[, ascii, ash, base32, basename, blockdev, bunzip2, bzcat, cat,
chroot, chvt, clear, cp, cpio, crc32, cut, date, dd, depmod, df,
dirname, dmesg, dnsdomainname, du, echo, egrep, eject, env, expr,
false, fbset, fdisk, fgconsole, fgrep, ftpget, gunzip, gzip, halt,
head, i2ctransfer, insmod, ip, ipaddr, iplink, iproute, kill,
killall, killall5, linux32, linux64, ln, ls, lsmod, lzcat, md5sum,
mdev, mkdir, mknod, modinfo, modprobe, mount, mv, ping, ping6,
poweroff, ps, pwd, reboot, reset, rm, rmdir, rmmod, run-parts,
setkeycodes, sh, sha1sum, sha256sum, sha3sum, sha512sum, shuf,
sleep, swapoff, swapon, sync, tail, tar, tee, test, true, truncate,
ts, umount, uname, unlink, unlzma, unxz, unzip, xzcat, yes, zcat

🧚 COMMAND DESCRIPTIONS 🧚

ash

ash [-il] [-|+Cabefmnuvx] [-|+o OPT]... [-c 'SCRIPT' [ARG0 ARGS] |
    FILE ARGS | -s ARGS]

Unix shell interpreter 🐚

base32

base32 [-d] [-w COL] [FILE]

Base32 encode or decode FILE to standard output.

  • -d β€” Decode data
  • -w COL β€” Wrap lines at COL (default 76, 0 disables)

basename

basename FILE [SUFFIX] | -a FILE... | -s SUFFIX FILE...

Strip directory path and SUFFIX from FILE.

  • -a β€” All arguments are FILEs
  • -s SUFFIX β€” Remove SUFFIX (implies -a)

blockdev

blockdev OPTION BLOCKDEV

Talk to a block device with the chosen OPTION, bestie. 🧱

  • --setro β€” Set ro
  • --setrw β€” Set rw
  • --getro β€” Get ro
  • --getss β€” Get sector size
  • --getbsz β€” Get block size
  • --setbsz BYTES β€” Set block size
  • --getsz β€” Get device size in 512-byte sectors
  • --getsize64 β€” Get device size in bytes
  • --getra β€” Get readahead in 512-byte sectors
  • --setra SECTORS β€” Set readahead
  • --flushbufs β€” Flush buffers
  • --rereadpt β€” Reread partition table

bunzip2

bunzip2 [-cfk] [FILE]...

Decompress FILEs (or stdin).

  • -c β€” Write to stdout
  • -f β€” Force
  • -k β€” Keep input files
  • -t β€” Test integrity

bzcat

bzcat [FILE]...

Decompress to stdout.

cat

cat [-nbvteA] [FILE]...

Print FILEs to stdout. 🐈

  • -n β€” Number output lines
  • -b β€” Number nonempty lines
  • -v β€” Show nonprinting characters as ^x or M-x
  • -t β€” ...and tabs as ^I
  • -e β€” ...and end lines with $
  • -A β€” Same as -vte

chroot

chroot NEWROOT [PROG ARGS]

Run PROG with root directory set to NEWROOT.

chvt

chvt N

Change the foreground virtual terminal to /dev/ttyN.

clear

clear

Clear screen. Sparkling. ✨

cp

cp [-arPLHpfinlsTu] SOURCE DEST
or: cp [-arPLHpfinlsu] SOURCE... { -t DIRECTORY | DIRECTORY }

Copy SOURCEs to DEST.

  • -a β€” Same as -dpR
  • -R,-r β€” Recurse
  • -d,-P β€” Preserve symlinks (default if -R)
  • -L β€” Follow all symlinks
  • -H β€” Follow symlinks on command line
  • -p β€” Preserve file attributes if possible
  • -f β€” Overwrite
  • -i β€” Prompt before overwrite
  • -n β€” Don't overwrite
  • -l,-s β€” Create (sym)links
  • -T β€” Refuse to copy if DEST is a directory
  • -t DIR β€” Copy all SOURCEs into DIR
  • -u β€” Copy only newer files

cpio

cpio [-dmvu] [-F FILE] [-R USER[:GRP]] [-H newc] [-tio] [-p DIR]
[EXTR_FILE]...

Extract (-i) or list (-t) files from a cpio archive, or take a file list from stdin and create an archive (-o) or copy files (-p).

Main operation mode:

  • -t β€” List
  • -i β€” Extract EXTR_FILEs (or all)
  • -o β€” Create (requires -H newc)
  • -p DIR β€” Copy files to DIR

Options:

  • -H newc β€” Archive format
  • -d β€” Make leading directories
  • -m β€” Restore mtime
  • -v β€” Verbose
  • -u β€” Overwrite
  • -F FILE β€” Input (-t,-i,-p) or output (-o) file
  • -R USER[:GRP] β€” Set owner of created files
  • -L β€” Dereference symlinks
  • -0 β€” NUL terminated input
  • --ignore-devno
  • --renumber-inodes

crc32

crc32 FILE...

Calculate CRC32 checksum of FILEs.

cut

cut [OPTIONS] [FILE]...

Print selected fields from FILEs to stdout.

  • -b LIST β€” Output only bytes from LIST
  • -c LIST β€” Output only characters from LIST
  • -d SEP β€” Field delimiter for input (default -f TAB, -F run of whitespace)
  • -O SEP β€” Field delimiter for output (default = -d for -f, one space for -F)
  • -D β€” Don't sort/collate sections or match -fF lines without delimiter
  • -f LIST β€” Print only these fields (-d is single char)
  • -F LIST β€” Print only these fields (-d is regex)
  • -s β€” Output only lines containing delimiter
  • -n β€” Ignored

date

date [OPTIONS] [+FMT] [[-s] TIME]

Display time (using +FMT), or set time.

  • -u β€” Work in UTC (don't convert to local time)
  • [-s] TIME β€” Set time to TIME
  • -d TIME β€” Display TIME, not now
  • -D FMT β€” FMT (strptime format) for -s/-d TIME conversion
  • -r FILE β€” Display last modification time of FILE
  • -R β€” Output RFC-2822 date
  • -I[SPEC] β€” Output ISO-8601 date
    • SPEC=date (default), hours, minutes, seconds or ns

Recognized TIME formats:

@seconds_since_1970
hh:mm[:ss]
[YYYY.]MM.DD-hh:mm[:ss]
YYYY-MM-DD hh:mm[:ss]
[[[[[YY]YY]MM]DD]hh]mm[.ss]
'date TIME' form accepts MMDDhhmm[[YY]YY][.ss] instead

dd

dd [if=FILE] [of=FILE] [ibs=N obs=N/bs=N] [count=N] [skip=N]
    [seek=N]      [conv=notrunc|noerror|sync|fsync]
         [iflag=skip_bytes|count_bytes|fullblock|direct]
    [oflag=seek_bytes|append|direct]

Copy a file with converting and formatting.

okay bestie, we are still deep in dd's option menu and it is giving build-your-own-copy-ritual πŸ’…

  • if=FILE β€” read from FILE instead of stdin
  • of=FILE β€” write to FILE instead of stdout
  • bs=N β€” read and write N bytes at a time
  • ibs=N β€” read N bytes at a time
  • obs=N β€” write N bytes at a time
  • count=N β€” copy only N input blocks
  • skip=N β€” skip N input blocks
  • seek=N β€” skip N output blocks
  • conv=notrunc β€” don't truncate output file
  • conv=noerror β€” continue after read errors
  • conv=sync β€” pad blocks with zeros
  • conv=fsync β€” physically write data out before finishing
  • conv=swab β€” swap every pair of bytes
  • iflag=skip_bytes β€” skip=N is in bytes
  • iflag=count_bytes β€” count=N is in bytes
  • oflag=seek_bytes β€” seek=N is in bytes
  • iflag=direct β€” O_DIRECT input
  • oflag=direct β€” O_DIRECT output
  • iflag=fullblock β€” read full blocks
  • oflag=append β€” open output in append mode
  • status=noxfer β€” suppress rate output
  • status=none β€” suppress all output

and bestie, N may be suffixed by c (1), w (2), b (512), kB (1000), k (1024), MB, M, GB, G β€” iconic little unit menu πŸŽ€


depmod ✨

depmod [-n] [-b BASE] [VERSION] [MODFILES]...

Generate modules.dep, alias, and symbols files β€” literal module-dependency lore.

  • -b BASE β€” use BASE/lib/modules/VERSION
  • -n β€” dry run: print files to stdout

df 🌸

df [-PkmhTai] [-B SIZE] [-t TYPE] [FILESYSTEM]...

Print filesystem usage statistics β€” the β€œwhere did my disk space go” check.

  • -P β€” POSIX output format
  • -k β€” 1024-byte blocks (default)
  • -m β€” 1M-byte blocks
  • -h β€” human readable (e.g. 1K 243M 2G)
  • -T β€” print filesystem type
  • -t TYPE β€” print only mounts of this type
  • -a β€” show all filesystems
  • -i β€” inodes
  • -B SIZE β€” blocksize

dirname πŸ¦‹

dirname FILENAME

Strip non-directory suffix from FILENAME β€” the path’s last-slash era ends here.

dmesg πŸ’œ

dmesg [-cr] [-n LEVEL] [-s SIZE]

Print or control the kernel ring buffer β€” kernel gossip, basically.

  • -c β€” clear ring buffer after printing
  • -n LEVEL β€” set console logging level
  • -s SIZE β€” buffer size
  • -r β€” print raw message buffer

du πŸ“

du [-aHLdclsxhmk] [FILE]...

Summarize disk space used for FILEs (or directories).

  • -a β€” show file sizes too
  • -b β€” apparent size (including holes)
  • -L β€” follow all symlinks
  • -H β€” follow symlinks on command line
  • -d N β€” limit output to directories (and files with -a) of depth < N
  • -c β€” show grand total
  • -l β€” count sizes many times if hard linked
  • -s β€” display only a total for each argument
  • -x β€” skip directories on different filesystems
  • -h β€” sizes in human readable format (e.g., 1K 243M 2G)
  • -m β€” sizes in megabytes
  • -k β€” sizes in kilobytes

Default unit is 512 bytes.

echo 🫢

echo [-neE] [ARG]...

Print ARGs to stdout.

  • -n β€” no trailing newline
  • -e β€” interpret backslash escapes (\t=tab etc)
  • -E β€” don't interpret backslash escapes (default)

eject πŸ’Ώ

eject [-t] [-T] [DEVICE]

Eject DEVICE or default /dev/cdrom β€” goodbye, lil disc.

  • -s β€” SCSI device
  • -t β€” close tray
  • -T β€” open/close tray (toggle)

env 🌈

env [-i0] [-u NAME]... [-] [NAME=VALUE]... [PROG ARGS]

Print current environment or run PROG after setting up environment.

  • -, -i β€” start with empty environment
  • -0 β€” NUL terminated output
  • -u NAME β€” remove variable from environment

expr πŸ”₯

expr EXPRESSION

Print the value of EXPRESSION.

EXPRESSION may be:

  • ARG1 | ARG2 β€” ARG1 if it is neither null nor 0, otherwise ARG2
  • ARG1 & ARG2 β€” ARG1 if neither argument is null or 0, otherwise 0
  • ARG1 < ARG2 β€” 1 if ARG1 is less than ARG2, else 0. Similarly:
    • ARG1 <= ARG2
    • ARG1 = ARG2
    • ARG1 != ARG2
    • ARG1 >= ARG2
    • ARG1 > ARG2
  • ARG1 + ARG2 β€” sum of ARG1 and ARG2. Similarly:
    • ARG1 - ARG2
    • ARG1 * ARG2
    • ARG1 / ARG2
    • ARG1 % ARG2
  • STRING : REGEXP β€” anchored pattern match of REGEXP in STRING
  • match STRING REGEXP β€” same as STRING : REGEXP
  • substr STRING POS LEN β€” substring of STRING, POS counts from 1
  • index STRING CHARS β€” index in STRING where any CHARS is found, or 0
  • length STRING β€” length of STRING
  • quote TOKEN β€” interpret TOKEN as a string, even if it is a keyword like 'match' or an operator like '/'
  • (EXPRESSION) β€” value of EXPRESSION
⚠️ caveat time, bestie: beware that many operators need to be escaped or quoted for shells. Comparisons are arithmetic if both ARGs are numbers, else lexicographical. Pattern matches return the string matched between \( and \) or null; if \( and \) are not used, they return the number of characters matched or 0.

fbset πŸŽ€

fbset [OPTIONS] [MODE]

Show and modify frame buffer settings.

fdisk 🧚

fdisk [-ul] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK

Change partition table.

  • -u β€” start and end are in sectors (instead of cylinders)
  • -l β€” show partition table for each DISK, then exit
  • -b 2048 β€” (for certain MO disks) use 2048-byte sectors
  • -C CYLINDERS β€” set number of cylinders/heads/sectors
  • -H HEADS β€” typically 255
  • -S SECTORS β€” typically 63

fgconsole ⭐

fgconsole

Get active console.

ftpget πŸ¦‹

ftpget [OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE

Download a file via FTP.

  • -c β€” continue previous transfer
  • -v β€” verbose
  • -u USER β€” username
  • -p PASS β€” password
  • -P PORT β€” the PORT value goes here

gunzip 🫧

gunzip [-cfkt] [FILE]...

Decompress FILEs (or stdin).

  • -c β€” write to stdout
  • -f β€” force
  • -k β€” keep input files
  • -t β€” test integrity

gzip ✨

gzip [-cfkdt] [FILE]...

Compress FILEs (or stdin).

  • -d β€” decompress
  • -c β€” write to stdout
  • -f β€” force
  • -k β€” keep input files
  • -t β€” test integrity

halt πŸ’€

halt [-d DELAY] [-nf]

Halt the system.

  • -d SEC β€” delay interval
  • -n β€” do not sync
  • -f β€” force (don't go through init)
head [OPTIONS] [FILE]...

Print first 10 lines of FILEs (or stdin). With more than one FILE, precede each with a filename header.

  • -n N[bkm] β€” print first N lines
  • -n -N[bkm] β€” print all except N last lines
  • -c [-]N[bkm] β€” print first N bytes (b:*512 k:*1024 m:*1024^2)
  • -q β€” never print headers
  • -v β€” always print headers

i2ctransfer 🌸

i2ctransfer [-fay] I2CBUS { rLENGTH[@ADDR] | wLENGTH[@ADDR] DATA...}...

Read/write I2C data in one transfer.

  • -f β€” force access to busy addresses
  • -a β€” force access to non-regular addresses
  • -y β€” disable interactive mode

insmod 🧩

insmod FILE [SYMBOL=VALUE]...

Load kernel module.

ip 🌈

ip [OPTIONS] address|route|link [ARGS]

OPTIONS := -f[amily] inet|inet6|link | -o[neline]

ip addr add|del IFADDR dev IFACE | show|flush [dev IFACE] [to
PREFIX] ip route list|flush|add|del|change|append|replace|test ROUTE
ip link set IFACE [up|down] [arp on|off] [multicast on|off]
     [promisc on|off] [mtu NUM] [name NAME] [qlen NUM] [address MAC]
     [master IFACE | nomaster] [netns PID]

This one is a whole main-character vibe: address, route, link, and args.

ipaddr πŸ’…

ipaddr add|del IFADDR dev IFACE | show|flush [dev IFACE] [to PREFIX]

ipaddr add|change|replace|delete dev IFACE [CONFFLAG-LIST] IFADDR
     IFADDR := PREFIX | ADDR peer PREFIX [broadcast ADDR|+|-]
          [anycast ADDR] [label STRING] [scope SCOPE]      PREFIX :=
ADDR[/MASK]      SCOPE := [host|link|global|NUMBER]      CONFFLAG-
LIST := [CONFFLAG-LIST] CONFFLAG      CONFFLAG := [noprefixroute]
ipaddr show|flush [dev IFACE] [scope SCOPE] [to PREFIX] [label
PATTERN]

The address-specific branch of ip β€” yes, it has lore.

iplink set IFACE [up|down] [arp on|off] [multicast on|off]
     [promisc on|off] [mtu NUM] [name NAME] [qlen NUM] [address MAC]
     [master IFACE | nomaster] [netns PID] iplink add [link IFACE]
IFACE [address MAC] type TYPE [ARGS] iplink delete IFACE type TYPE
[ARGS]      TYPE ARGS := vlan VLANARGS | vrf table NUM      VLANARGS
:= id VLANID [protocol 802.1q|802.1ad] [reorder_hdr on|off]
     [gvrp on|off] [mvrp on|off] [loose_binding on|off] iplink
show [IFACE]

Link-layer branch, with vlan and vrf table NUM details.

iproute πŸ›£οΈ

iproute list|flush|add|del|change|append|replace|test ROUTE

iproute list|flush SELECTOR      SELECTOR := [root PREFIX] [match
PREFIX] [proto RTPROTO]      PREFIX := default|ADDR[/MASK] iproute
get ADDR [from ADDR iif IFACE]      [oif IFACE] [tos TOS] iproute
add|del|change|append|replace|test ROUTE      ROUTE := NODE_SPEC
[INFO_SPEC]      NODE_SPEC := PREFIX [proto RTPROTO] [scope SCOPE]
[metric METRIC]      INFO_SPEC := NH OPTIONS      NH := [via
[inet|inet6] ADDR] [dev IFACE] [src ADDR] [onlink]      OPTIONS :=
[mtu [lock] NUM] [advmss [lock] NUM]

Route table branch, selector specs and NH/OPTIONS included.

kill πŸ”ͺ

kill [-l] [-SIG] PID...

Send a signal (default: TERM) to given PIDs.

  • -l β€” list all signal names and numbers

killall πŸ’₯

killall [-lq] [-SIG] PROCESS_NAME...

Send a signal (default: TERM) to given processes.

  • -l β€” list all signal names and numbers
  • -q β€” don't complain if no processes were killed

killall5 πŸŒͺ️

killall5 [-l] [-SIG] [-o PID]...

Send a signal (default: TERM) to all processes outside current session.

  • -l β€” list all signal names and numbers
  • -o PID β€” don't signal this PID

ln πŸŽ€

ln [-sfnbtv] [-S SUF] TARGET... LINK|DIR

Create a link LINK or DIR/TARGET to the specified TARGET(s).

  • -s β€” make symlinks instead of hardlinks, cute lil shortcuts πŸ’«
  • -f β€” remove existing destinations, no mercy
  • -n β€” don't dereference symlinks β€” treat like a normal file, leave the link alone
  • -b β€” make a backup of the target (if it exists) before the link operation, so you can always undo it 🫢
  • -S SUF β€” use SUF as the suffix instead of ~ when making backup files
  • -T β€” treat LINK as a file, not a DIR
  • -v β€” verbose, tell me everything πŸ’¬

🌈 ls

ls [-1AaCxdLHRFplinshctu] [-w WIDTH] [FILE]...

List directory contents β€” the moment of truth, bestie πŸ‘‘

  • -1 β€” one column output
  • -a β€” include names starting with . (yes, the hidden ones, the secrets)
  • -A β€” like -a, but exclude . and ..
  • -x β€” list by lines
  • -d β€” list directory names, not contents
  • -L β€” follow symlinks
  • -H β€” follow symlinks on command line
  • -R β€” recurse, go all the way down πŸŒ€
  • -p β€” append / to directory names
  • -F β€” append indicator (one of */=@|) to names
  • -l β€” long format, the classic
  • -i β€” list inode numbers
  • -n β€” list numeric UIDs and GIDs instead of names
  • -s β€” list allocated blocks
  • -lc β€” list ctime
  • -lu β€” list atime
  • --full-time β€” list full date/time
  • -h β€” human readable sizes (1K 243M 2G) β€” because 1048576 is not it πŸ’…
  • -t β€” sort by mtime
  • -tc β€” sort by ctime
  • -tu β€” sort by atime
  • -r β€” reverse sort order
  • -w N β€” format N columns wide

🧩 lsmod

lsmod

List loaded kernel modules. That's it, that's the whole vibe ✨

πŸ—œοΈ lzcat

lzcat [FILE]...

Decompress to stdout β€” right into your terminal's DMs πŸ“¨

πŸ” md5sum

md5sum [-c[sw]] [FILE]...

Print or check MD5 checksums

  • -c β€” check sums against the list in FILEs
  • -s β€” don't output anything, the status code shows success (silent but deadly πŸ’€)
  • -w β€” warn about improperly formatted checksum lines

🌸 mdev

mdev [-vS] { [-s] | [-df] }
  • -v β€” verbose
  • -S β€” log to syslog too
  • -s β€” scan /sys and populate /dev
  • -d β€” daemon, listen on netlink
  • -f β€” run in foreground

Bare mdev is a kernel hotplug helper. To activate it:

echo /sbin/mdev >/proc/sys/kernel/hotplug

It uses /etc/mdev.conf with lines

[-][ENV=regex;]...DEVNAME UID:GID PERM [>|=PATH]|[!] [@|$|*PROG]

where DEVNAME is a device name regex, @major,minor[-minor2], or an environment variable regex. A common use of the latter is to load modules for hotplugged devices:

$MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"

If /dev/mdev.seq file exists, mdev will wait for its value to match the $SEQNUM variable. This prevents plug/unplug races. To activate this feature, create an empty /dev/mdev.seq at boot. 🏁

If /dev/mdev.log file exists, the debug log will be appended to it.

πŸ“ mkdir

mkdir [-m MODE] [-p] DIRECTORY...

Create DIRECTORY

  • -m MODE β€” mode
  • -p β€” no error if it exists; make parent directories as needed (iconic founder behaviour πŸ‘‘

πŸ”§ mknod

mknod [-m MODE] NAME TYPE [MAJOR MINOR]

Create a special file (block, character, or pipe)

  • -m MODE β€” creation mode (default a=rw)

TYPE:

  • b β€” block device
  • c or u β€” character device
  • p β€” named pipe (MAJOR MINOR must be omitted)

πŸ” modinfo

modinfo [-adlpn0] [-F keyword] MODULE
  • -a β€” shortcut for -F author
  • -d β€” shortcut for -F description
  • -l β€” shortcut for -F license
  • -p β€” shortcut for -F parm
  • -F keyword β€” keyword to look for
  • -0 β€” NUL terminated output

🧠 modprobe

modprobe [-alrqvsDb] MODULE [SYMBOL=VALUE]...
  • -a β€” load multiple MODULEs
  • -l β€” list (MODULE is a pattern)
  • -r β€” remove MODULE (stacks) or do autoclean
  • -q β€” quiet 🀫
  • -v β€” verbose
  • -s β€” log to syslog
  • -D β€” show dependencies
  • -b β€” apply blacklist to module names too

πŸ’Ύ mount

mount [OPTIONS] [-o OPT] DEVICE NODE

Mount a filesystem. Filesystem autodetection requires /proc. πŸ—‚οΈ

  • -a β€” mount all filesystems in fstab
  • -f β€” dry run
  • -v β€” verbose
  • -r β€” read-only mount
  • -t FSTYPE[,...] β€” filesystem type(s)
  • -T FILE β€” read FILE instead of /etc/fstab
  • -O OPT β€” mount only filesystems with option OPT (-a only)

-o OPT:

  • [a]sync β€” writes are [a]synchronous
  • [no]atime β€” disable/enable updates to inode access times
  • [no]diratime β€” disable/enable atime updates to directories
  • [no]relatime β€” disable/enable atime updates relative to modification time
  • [no]dev β€” (dis)allow use of special device files
  • [no]exec β€” (dis)allow use of executable files
  • [no]suid β€” (dis)allow set-user-id-root programs
  • [r]shared β€” convert [recursively] to a shared subtree
  • [r]slave β€” convert [recursively] to a slave subtree
  • [r]private β€” convert [recursively] to a private subtree
  • [un]bindable β€” make mount point [un]able to be bind mounted
  • [r]bind β€” bind a file or directory [recursively] to another location
  • move β€” relocate an existing mount point
  • remount β€” remount a mounted filesystem, changing flags
  • ro β€” same as -r
There are filesystem-specific -o flags. 🫑

🚚 mv

mv [-finT] SOURCE DEST

or:

mv [-fin] SOURCE... { -t DIRECTORY | DIRECTORY }

Rename SOURCE to DEST, or move SOURCEs to DIRECTORY

  • -f β€” don't prompt before overwriting
  • -i β€” interactive, prompt before overwrite
  • -n β€” don't overwrite an existing file
  • -T β€” refuse to move if DEST is a directory
  • -t DIR β€” move all SOURCEs into DIR

πŸ“‘ ping

ping HOST

Send ICMP ECHO_REQUESTs to HOST. Are you there bestie?? πŸ‘‹

πŸ“‘ ping6

ping6 HOST

Send ICMP ECHO_REQUESTs to HOST β€” same energy, v6 edition 🌐

πŸ”Œ poweroff

poweroff [-d DELAY] [-nf]

Halt and shut off power

  • -d SEC β€” delay interval
  • -n β€” do not sync
  • -f β€” force (don't go through init)

πŸ“‹ ps

ps [-o COL1,COL2=HEADER] [-T]

Show list of processes

  • -o COL1,COL2=HEADER β€” select columns for display
  • -T β€” show threads

πŸ“ pwd

pwd

Print the full filename of the current working directory. Where am I?? 😭

πŸ” reboot

reboot [-d DELAY] [-nf]

Reboot the system

  • -d SEC β€” delay interval
  • -n β€” do not sync
  • -f β€” force (don't go through init)

πŸ–₯️ reset

reset

Reset the screen. Ctrl+J, reset, enter β€” the holy trinity of "my terminal is cooked" πŸ’€

πŸ—‘οΈ rm

rm [-irf] FILE...

Remove (unlink) FILEs

  • -i β€” always prompt before removing
  • -f β€” never prompt
  • -R, -r β€” recurse

πŸ“‚ rmdir

rmdir [-p] DIRECTORY...

Remove DIRECTORY if it is empty

  • -p β€” include parents
  • --ignore-fail-on-non-empty

πŸ“€ rmmod

rmmod [-wfa] [MODULE]...

Unload kernel modules

  • -w β€” wait until the module is no longer used
  • -f β€” force unload
  • -a β€” remove all unused modules (recursively)

πŸƒ run-parts

run-parts [-a ARG]... [-u UMASK] [--reverse] [--test] [--exit-on-error] DIRECTORY

Run a bunch of scripts in DIRECTORY

  • -a ARG β€” pass ARG as an argument to scripts
  • -u UMASK β€” set UMASK before running scripts
  • --reverse β€” reverse execution order
  • --test β€” dry run
  • --exit-on-error β€” exit if a script exits with non-zero

⌨️ setkeycodes

setkeycodes { SCANCODE KEYCODE }...

Modify the kernel's scancode-to-keycode map, allowing unusual keyboards to generate usable keycodes. Your weird keyboard deserves love too 🫢

SCANCODE is either xx or e0xx (hexadecimal), KEYCODE is decimal.

🐚 sh

sh [-il] [-|+Cabefmnuvx] [-|+o OPT]... [-c 'SCRIPT' [ARG0 ARGS] | FILE ARGS | -s ARGS]

Unix shell interpreter. The main character of the whole OS πŸ‘‘

πŸ” sha1sum

sha1sum [-c[sw]] [FILE]...

Print or check SHA1 checksums

  • -c β€” check sums against the list in FILEs
  • -s β€” don't output anything, the status code shows success
  • -w β€” warn about improperly formatted checksum lines

πŸ” sha256sum

sha256sum [-c[sw]] [FILE]...

Print or check SHA256 checksums

  • -c β€” check sums against the list in FILEs
  • -s β€” don't output anything, the status code shows success
  • -w β€” warn about improperly formatted checksum lines

πŸ” sha3sum

sha3sum [-c[sw]] [-a BITS] [FILE]...

Print or check SHA3 checksums

  • -c β€” check sums against the list in FILEs
  • -s β€” don't output anything, the status code shows success
  • -w β€” warn about improperly formatted checksum lines
  • -a BITS β€” 224 (default), 256, 384, 512

πŸ” sha512sum

sha512sum [-c[sw]] [FILE]...

Print or check SHA512 checksums

  • -c β€” check sums against the list in FILEs
  • -s β€” don't output anything, the status code shows success
  • -w β€” warn about improperly formatted checksum lines

🎲 shuf

shuf [-n NUM] [-o FILE] [-z] [FILE | -e [ARG...] | -i L-H]

Randomly permute lines β€” chaos, but make it organized ✨

  • -n NUM β€” output at most NUM lines
  • -o FILE β€” write to FILE, not standard output
  • -z β€” NUL terminated output
  • -e β€” treat ARGs as lines
  • -i L-H β€” treat numbers L-H as lines

😴 sleep

sleep [N]...

Pause for a time equal to the total of the args given, where each arg can have an optional suffix of (s)econds, (m)inutes, (h)ours, or (d)ays. Me when someone says "five more minutes" πŸ›Œ

πŸ”„ swapoff

swapoff [-a] [DEVICE]

Stop swapping on DEVICE

  • -a β€” stop swapping on all swap devices

πŸ”„ swapon

swapon [-a] [-e] [-d[POL]] [DEVICE]

Start swapping on DEVICE

  • -a β€” start swapping on all swap devices
  • -d[POL] β€” discard blocks at swapon (POL=once), as freed (POL=pages), or both (POL omitted)
  • -e β€” silently skip devices that do not exist

πŸ’½ sync

sync

Write all buffered blocks to disk. Flush it, bestie 🚽✨

πŸ• tail

tail [OPTIONS] [FILE]...

...it prints the last 10 lines of FILEs (or stdin) πŸ’… and when you hand it more than one FILE, it puts a filename header in front of each one so you actually know which is which.

  • -c [+]N[bkm] β€” print the last N bytes
  • -n N[bkm] β€” print the last N lines
  • -n +N[bkm] β€” start on the *N*th line and print the rest
  • -q β€” never print headers
  • -v β€” always print headers
  • -f β€” print data as the file grows
  • -F β€” same as -f, but keep retrying
  • -s SECONDS β€” wait SECONDS between reads while using -f
the size suffix tea 🍡: b:*512 k:*1024 m:*1024^2 β€” iykyk, that's bytes/kilos/megas with the multipliers to match.

πŸ—„οΈ tar

tar tar c|x|t [-ZzJjahmvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE]
    [LONGOPT]... [FILE]...

Create, extract, or list files out of a tar file πŸŽ€

  • c β€” create
  • x β€” extract
  • t β€” list
  • -f FILE β€” name of TARFILE ('-' means stdin/out, iconic)
  • -C DIR β€” change to DIR before the operation
  • -v β€” verbose
  • -O β€” extract to stdout
  • -m β€” don't restore mtime
  • -o β€” don't restore user:group
  • -k β€” don't replace files that already exist
  • -Z β€” (de)compress using compress
  • -z β€” (de)compress using gzip
  • -J β€” (de)compress using xz
  • -j β€” (de)compress using bzip2
  • --lzma β€” (de)compress using lzma
  • -a β€” (de)compress based on extension
  • -h β€” follow symlinks
  • -T FILE β€” file with names to include
  • -X FILE β€” file with glob patterns to exclude
  • --exclude PATTERN β€” glob pattern to exclude
  • --overwrite β€” replace existing files
  • --strip-components NUM β€” strip NUM leading components
  • --no-recursion β€” don't descend into directories
  • --numeric-owner β€” use numeric user:group
  • --no-same-permissions β€” don't restore access permissions
  • --to-command COMMAND β€” pipe files to COMMAND

πŸ«– tee

tee tee [-ai] [FILE]...

Copies stdin into each FILE, and also to stdout (both, bestie, it does both ✨)

  • -a β€” append to the given *FILE*s instead of overwriting
  • -i β€” ignore interrupt signals (SIGINT)

βœ‚οΈ truncate

truncate [-c] -s SIZE FILE...

Truncates FILEs down to SIZE

  • -c β€” do not create files
  • -s SIZE β€” the size, obviously πŸ’…

⏰ ts

ts [-is] [STRFTIME]

Pipes stdin to stdout and stamps a timestamp onto every single line πŸ•°οΈ

  • -s β€” time since start
  • -i β€” time since the previous line

πŸ“΄ umount

umount [-rlfa] [-t FSTYPE] FILESYSTEM|DIRECTORY

Unmounts filesystems, no cap

  • -a β€” unmount all filesystems
  • -r β€” remount devices read-only if the mount is busy
  • -l β€” lazy umount (detach the filesystem)
  • -f β€” force umount (i.e., for an unreachable NFS server)
  • -t FSTYPE[,...] β€” unmount only these filesystem type(s)

πŸ–₯️ uname

uname [-amnrspvio]

Prints system information, the classic "who even am I" applet πŸ¦‹

  • -a β€” print all
  • -m β€” machine (hardware) type
  • -n β€” hostname
  • -r β€” kernel release
  • -s β€” kernel name (this one's the default)
  • -p β€” processor type
  • -v β€” kernel version
  • -i β€” hardware platform
  • -o β€” OS name

unlink FILE

Deletes FILE by calling unlink() β€” yes that's the whole applet, she's minimal πŸ’…


πŸ—œοΈ unlzma

unlzma [-cfk] [FILE]...

Decompresses *FILE*s (or stdin)

  • -c β€” write to stdout
  • -f β€” force
  • -k β€” keep input files
  • -t β€” test integrity

πŸ—œοΈ unxz

unxz [-cfk] [FILE]...

Decompresses *FILE*s (or stdin), same energy as her lzma sister ✨

  • -c β€” write to stdout
  • -f β€” force
  • -k β€” keep input files
  • -t β€” test integrity

🎁 unzip

unzip [-lnojpq] FILE[.zip] [FILE]... [-x FILE]... [-d DIR]

Extracts *FILE*s out of a ZIP archive πŸ“

  • -l β€” list contents (with -q for the short form)
  • -n β€” never overwrite files (default is: ask)
  • -o β€” overwrite
  • -j β€” do not restore paths
  • -p β€” write to stdout
  • -t β€” test
  • -q β€” quiet
  • -x FILE β€” exclude *FILE*s
  • -d DIR β€” extract into DIR

🌈 xzcat

xzcat [FILE]...

Decompresses to stdout, that's it, that's the vibe


βœ… yes

yes [STRING]

Repeatedly prints a line with STRING, or 'y' if you don't give one β€” infinite agreement, main character energy fr fr


🐱 zcat

zcat [FILE]...

Decompresses to stdout πŸ’œ


🧚 LIBC NSS ✨

Okay so this bit is a whole thing, listen 🫢 GNU Libc (glibc) uses the Name Service Switch (NSS) to configure how the C library behaves for the local environment, and to configure how it reads system data β€” stuff like passwords and group information. It's implemented with an /etc/nsswitch.conf configuration file plus one or more of the /lib/libnss_* libraries. BusyBox tries to avoid using any libc calls that go through NSS, but some applets β€” login and su, looking at you πŸ‘€ β€” will use libc functions that need NSS.

If you enable CONFIG_USE_BB_PWD_GRP, BusyBox uses internal functions to directly access the /etc/passwd, /etc/group, and /etc/shadow files without touching NSS. Which may legitimately let you run your system without installing any of the NSS configuration files and libraries. Slay.

When used with glibc, the BusyBox 'networking' applets will similarly require that you install at least some of the glibc NSS stuff β€” in particular /etc/nsswitch.conf, /lib/libnss_dns*, /lib/libnss_files*, and /lib/libresolv* 😭

Shameless Plug πŸ’…: as an alternative, one could use a C library such as uClibc. On top of making your system significantly smaller, uClibc does not require the use of any NSS support files or libraries. Obsessed.

πŸ‘‘ MAINTAINER

Denis Vlasenko <vda.linux@googlemail.com>


πŸ’– AUTHORS

The following people have contributed code to BusyBox β€” whether they know it or not 😌 If you have written code included in BusyBox, you should probably be listed here so you can obtain your bit of eternal glory πŸ‘‘ If you should be listed here, or the description of what you've done needs more detail, or is just incorrect, please send in an update.

  • Emanuele Aina <emanuele.aina@tiscali.it> β€” run-parts
  • Erik Andersen <andersen@codepoet.org> β€” tons of new stuff, a major rewrite of most of the core apps, tons of new apps as noted in header files, plus lots of tedious effort writing these boring docs that nobody is actually going to read 😭
  • Laurence Anderson <l.d.anderson@warwick.ac.uk> β€” rpm2cpio, unzip, get_header_cpio, read_gz interface, rpm
  • Jeff Angielski <jeff@theptrgroup.com> β€” ftpput, ftpget
  • Edward Betts <edward@debian.org> β€” expr, hostid, logname, whoami
  • John Beppu <beppu@codepoet.org> β€” du, nslookup, sort
  • Brian Candler <B.Candler@pobox.com> β€” tiny-ls(ls)
  • Randolph Chung <tausq@debian.org> β€” fbset, ping, hostname
  • Dave Cinege <dcinege@psychosis.com> β€” more(v2), makedevs, dutmp, modularization, auto links file, various fixes, Linux Router Project maintenance
  • Jordan Crouse <jordan@cosmicpenguin.net> β€” ipcalc
  • Magnus Damm <damm@opensource.se> β€” tftp client, insmod powerpc support
  • Larry Doolittle <ldoolitt@recycle.lbl.gov> β€” pristine source directory compilation, lots of patches and fixes
  • Glenn Engel <glenne@engel.org> β€” httpd
  • Gennady Feldman <gfeldman@gena01.com> β€” Sysklogd (single threaded syslogd, IPC Circular buffer support, logread), various fixes
  • Karl M. Hegbloom <karlheg@debian.org> β€” cp_mv.c, the test suite, various fixes to utility.c, &c.
  • Daniel Jacobowitz <dan@debian.org> β€” mktemp.c
  • Matt Kraai <kraai@alumni.cmu.edu> β€” documentation, bugfixes, test suite
  • Stephan Linz <linz@li-pro.net> β€” ipcalc, Red Hat equivalence
  • John Lombardo <john@deltanet.com> β€” tr
  • Glenn McGrath <bug1@iinet.net.au> β€” common unarchiving code and unarchiving applets, ifupdown, ftpgetput, nameif, sed, patch, fold, install, uudecode, plus various bugfixes, review and apply numerous patches
  • Manuel Novoa III <mjn3@codepoet.org> β€” cat, head, mkfifo, mknod, rmdir, sleep, tee, tty, uniq, usleep, wc, yes, mesg, vconfig, make_directory, parse_mode, dirname, mode_string, get_last_path_component, simplify_path, and a number trivial libbb routines β€” also bug fixes, partial rewrites, and size optimizations in ash, basename, cal, cmp, cp, df, du, echo, env, ln, logname, md5sum, mkdir, mv, realpath, rm, sort, tail, touch, uname, watch, arith, human_readable, interface, dutmp, ifconfig, route
  • Vladimir Oleynik <dzo@simtreas.ru> β€” cmdedit; xargs(current), httpd(current); ports: ash, crond, fdisk, inetd, stty, traceroute, top; locale, various fixes, and irreconcilable critic of everything not perfect πŸ’€
  • Bruce Perens <bruce@pixar.com> β€” original author of BusyBox in 1995, 1996. Some of his code can still be found hiding here and there...
  • Tim Riker <Tim@Rikers.org> β€” bug fixes, member of fan club 🫢
  • Kent Robotti <robotti@metconnect.com> β€” reset, tons and tons of bug reports and patches
  • Chip Rosenthal <chip@unicom.com>, <crosenth@covad.com> β€” wget β€” contributed by permission of Covad Communications
  • Pavel Roskin <proski@gnu.org> β€” lots of bugs fixes and patches
  • Gyepi Sam <gyepi@praxis-sw.com> β€” remote logging feature for syslogd
  • Linus Torvalds <torvalds@transmeta.com> β€” mkswap, fsck.minix, mkfs.minix
  • Mark Whitley <markw@codepoet.org> β€” grep, sed, cut, xargs(previous), style-guide, new-applet-HOWTO, bug fixes, etc.
  • Charles P. Wright <cpwright@villagenet.com> β€” gzip, mini-netcat(nc)
  • Enrique Zanardi <ezanardi@ull.es> β€” tarcat (since removed), loadkmap, various fixes, Debian maintenance
  • Tito Ragusa <farmatito@tiscali.it> β€” devfsd and size optimizations in strings, openvt and deallocvt
  • Paul Fox <pgf@foxharp.boston.ma.us> β€” vi editing mode for ash, various other patches/fixes
  • Roberto A. Foglietta <me@roberto.foglietta.name> β€” port: dnsd
  • Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> β€” misc
  • Mike Frysinger <vapier@gentoo.org> β€” initial e2fsprogs, printenv, setarch, sum, misc
  • Jie Zhang <jie.zhang@analog.com> β€” fixed two bugs in msh and hush (exitcode of killed processes)

that's the whole page bestie, you made it to the end πŸŽ€ this one's version 1.35.0, dated 2022-01-19 β€” go be iconic with it πŸ’…βœ¨

πŸ“¦ where this page comes from