BUSYBOX(1)
๐ BUSYBOX(1) ๐
okay bestie, you asked about the busybox manual page, and it's literally from the BUSYBOX(1) section of the manual, so buckle up because this thing is iconic and also LONG. ๐
โจ NAME โจ
BusyBox โ The Swiss Army Knife of Embedded Linux ๐
๐ SYNTAX ๐
busybox <applet> [arguments...] # or
<applet> [arguments...] # if symlinked
๐ธ DESCRIPTION ๐ธ
okay so picture this: BusyBox takes tiny versions of like a MILLION common UNIX utilities and shoves them all into one single small executable. it's giving "one binary to rule them all" ๐. it provides minimalist replacements for most of the utilities you'd usually find in GNU coreutils, util-linux, etc.
ngl the utilities in BusyBox generally have fewer options than their full-featured GNU cousins โ but lowkey that's the point? the options that ARE included still give you the expected functionality and behave very much like their GNU counterparts. no cap. ๐ซถ
BusyBox was written with size-optimization and limited resources in mind. it's also extremely modular, so you can easily include or exclude commands (or features) at compile time. this makes it easy to customize your embedded systems. to create a working system, you literally just add /dev, /etc, and a Linux kernel. that's it. BusyBox provides a fairly complete POSIX environment for any small or embedded system. slay. โจ
BusyBox is extremely configurable too. this allows you to include ONLY the components you need, thereby reducing binary size. run make config or make menuconfig to select the functionality that you wish to enable. then run make to compile BusyBox using your configuration. ๐ ๏ธ
after the compile has finished, you should use make install to install BusyBox. this will install the bin/busybox binary, in the target directory specified by CONFIG_PREFIX. CONFIG_PREFIX can be set when configuring BusyBox, or you can specify an alternative location at install time (i.e., with a command line like make CONFIG_PREFIX=/tmp/foo install). and 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. so organized ๐
๐ฆ USAGE ๐ฆ
BusyBox is a multi-call binary. and what is that, you ask? it's an executable program that performs the same job as more than one utility program. so there's just a single BusyBox binary, but that single binary acts like a large number of utilities. main character energy, honestly ๐. it's also how BusyBox stays smaller โ all the built-in utility programs (we call them applets) can share code for many common operations. efficient queen ๐
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. periodt.
of course, adding /bin/busybox into every command would be painful. so most people will 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. we love a system that does the chores for us ๐
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. handy!!
๐ COMMON OPTIONS ๐
most BusyBox applets support the --help argument to provide a terse runtime description of their behavior. and if the CONFIG_FEATURE_VERBOSE_USAGE option has been enabled, more detailed usage information will also be available. so if --help felt a little too mysterious, that's why โ go poke the config ๐ซถ
๐ COMMANDS ๐
currently available applets include:
[, [[, acpid, adjtimex, ar, arch, arp, arping, ascii, ash, awk, base64,
basename, bc, blkdiscard, blkid, blockdev, brctl, bunzip2, bzcat, bzip2,
cal, cat, chattr, chgrp, chmod, chown, chpasswd, chroot, chvt, clear,
cmp, cp, cpio, crc32, crond, crontab, cttyhack, cut, date, dc, dd,
deallocvt, depmod, devmem, df, diff, dirname, dmesg, dnsdomainname,
dos2unix, dpkg, dpkg-deb, du, dumpkmap, dumpleases, echo, ed, egrep,
env, expand, expr, factor, fallocate, false, fatattr, fdisk, fgrep,
find, findfs, fold, free, freeramdisk, fsfreeze, fstrim, ftpget, ftpput,
getfattr, getopt, getty, grep, groups, gunzip, gzip, halt, head,
hexdump, hostid, hostname, httpd, hwclock, i2cdetect, i2cdump, i2cget,
i2cset, i2ctransfer, id, ifconfig, ifdown, ifup, init, insmod, install,
ionice, ip, ipcalc, kill, killall, klogd, last, less, link, linux32,
linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname,
logread, losetup, ls, lsattr, lsblk, lsmod, lsscsi, lzcat, lzma, lzop,
md5sum, mdev, microcom, mim, mkdir, mkdosfs, mke2fs, mkfifo, mknod,
mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mt, mv,
nameif, nbd-client, nc, netstat, nl, nohup, nologin, nproc, nsenter,
nslookup, nuke, od, openvt, partprobe, passwd, paste, patch, pidof,
ping, ping6, pivot_root, poweroff, printf, ps, pwd, rdate, readlink,
realpath, reboot, renice, reset, resize, resume, rev, rm, rmdir, rmmod,
route, rpm, rpm2cpio, run-init, run-parts, sed, seq, setkeycodes,
setpriv, setsid, sh, sha1sum, sha256sum, sha384sum, sha3sum, sha512sum,
shred, shuf, sleep, sort, ssl_client, ssl_server, start-stop-daemon,
stat, strings, stty, su, sulogin, svc, svok, swapoff, swapon,
switch_root, sync, sysctl, syslogd, tac, tail, tar, taskset, tc, tee,
telnet, test, tftp, time, timeout, top, touch, tr, traceroute,
traceroute6, true, truncate, ts, tty, tunctl, ubirename, udhcpc,
udhcpc6, udhcpd, uevent, umount, uname, uncompress, unexpand, uniq,
unix2dos, unlink, unlzma, unshare, unxz, unzip, uptime, usleep,
uudecode, uuencode, uuidgen, vconfig, vi, vmstat, w, watch, watchdog,
wc, wget, which, who, whoami, xargs, xxd, xz, xzcat, yes, zcat
that's a LOT of applets, bestie. a whole arsenal ๐
๐ COMMAND DESCRIPTIONS ๐
okay NOW we get to the good part โ the individual applets, one by one. let's go ๐
acpid
acpid [-df] [-c CONFDIR] [-l LOGFILE] [-a ACTIONFILE] [-M MAPFILE] [-e
PROC_EVENT_FILE] [-p PIDFILE]
Listen to ACPI events and spawn specific helpers on event arrival ๐
-dโ log to stderr, not log file (implies-f)-fโ run in foreground-c DIRโ config directory [/etc/acpi]-e FILEโ/procevent file [/proc/acpi/event]-l FILEโ log file [/var/log/acpid.log]-p FILEโ pid file [/var/run/acpid.pid]-a FILEโ action file [/etc/acpid.conf]-M FILEโ map file [/etc/acpi.map]
accept and ignore compatibility options -g -m -s -S -v. they exist, they're fine, we simply vibe past them ๐
adjtimex
adjtimex [-q] [-o OFS] [-f FREQ] [-p TCONST] [-t TICK]
read or set kernel time variables. see adjtimex(2) โฐ
-qโ quiet-o OFFโ time offset, in microseconds-f FREQโ frequency adjust, integer kernel units (65536 is 1ppm)-t TICKโ microseconds per tick, usually 10000 (positive-tor-fvalues make the clock run faster)-p TCONST
ar
ar x|p|t [-ov] ARCHIVE [FILE]...
extract or list FILEs from an ar archive ๐ฆ
xโ extractpโ extract to stdouttโ list-oโ restore mtime-vโ verbose
arch
arch
print system architecture ๐๏ธ (one word, zero drama)
arp
arp [-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME]
[-v] [-i IF] -d HOSTNAME [pub]
[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp]
[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub
[-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub
manipulate the ARP cache ๐ธ๏ธ
-aโ display (all) hosts-dโ delete ARP entry-sโ set new entry-vโ verbose-nโ don't resolve names-i IFโ network interface-Dโ readHWADDRfromIFACE-A,-p AFโ protocol family-H HWTYPEโ hardware address type
arping
arping [-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP
send ARP requests/replies ๐ก
-fโ quit on first ARP reply-qโ quiet-bโ keep broadcasting, don't go unicast-Dโ exit with1ifDST_IPreplies-Uโ unsolicited ARP mode, update your neighbors-Aโ ARP answer mode, update your neighbors-c Nโ stop after sending N ARP requests-w TIMEOUTโ seconds to wait for ARP reply-I IFACEโ interface to use (defaulteth0)-s SRC_IPโ sender IP addressDST_IPโ target IP address
ash
ash [-il] [-|+Cabefmnuvx] [-|+o OPT]... [-c 'SCRIPT' [ARG0 ARGS] | FILE
ARGS | -s ARGS]
the Unix shell interpreter ๐ (yes, it does the thing with the - and + prefixes, go read it again, it's all there)
awk
awk [OPTIONS] [AWK_PROGRAM] [FILE]...
-v VAR=VALโ set variable-F SEPโ useSEPas field separator-f/-E FILEโ read program fromFILE-e AWK_PROGRAM
base64
base64 [-d] [-w COL] [FILE]
base64 encode or decode FILE to standard output ๐ค
-dโ decode data-w COLโ wrap lines atCOL(default76,0disables)
basename
basename FILE [SUFFIX] | -a FILE... | -s SUFFIX FILE...
strip directory path and SUFFIX from FILE โ๏ธ
-aโ all arguments areFILEs-s SUFFIXโ removeSUFFIX(implies-a)
bc
bc [-sqlw] [FILE]...
arbitrary precision calculator ๐งฎ
-qโ quiet-lโ load standard library-sโ be POSIX compatible-wโ warn if extensions are used
$BC_LINE_LENGTH changes output width ๐
blkdiscard
blkdiscard [-o OFS] [-l LEN] [-s] DEVICE
discard sectors on DEVICE ๐๏ธ
-o OFSโ byte offset into device-l LENโ number of bytes to discard-sโ perform a secure discard
blkid
blkid [BLOCKDEV]...
print UUIDs of all filesystems ๐
blockdev
blockdev OPTION BLOCKDEV
--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
brctl
brctl COMMAND [BRIDGE [ARGS]]
manage ethernet bridges ๐ commands:
addbr BRIDGEโ createBRIDGEdelbr BRIDGEโ deleteBRIDGEaddif BRIDGE IFACEโ addIFACEtoBRIDGEdelif BRIDGE IFACEโ deleteIFACEfromBRIDGE
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 ๐ค
bzip2
bzip2 [-cfkdt123456789] [FILE]...
compress FILEs (or stdin) with the bzip2 algorithm ๐๏ธ
and that's the page so far, bestie โ there are literally more applets waiting in the next chunk, so don't go anywhere ๐
-1..9โ compression level bestie, pick your fighter (1 = lazy girl speed, 9 = try-hard ๐ )-dโ decompress, put it back the way it was-cโ write tostdout, don't touch the actual files-fโ force it, no questions, no regrets-kโ keep the input files around (don't delete them, we're not monsters)-tโ test the integrity, it's giving vibe check but for archives ๐
โจ cal โจ
cal [-jmy] [[MONTH] YEAR]
Display a calendar ๐๏ธ so you can literally see the days
-jโ use julian dates-mโ week starts on Monday (correct behavior honestly)-yโ display the entire year
โจ cat โจ
cat [-nbvteA] [FILE]...
Print FILEs to stdout ๐ the classic, the icon, the moment
-nโ number output lines-bโ number nonempty lines-vโ show nonprinting characters as^xorM-x-tโ ...and tabs as^I-eโ ...and end lines with$-Aโ same as-vte
โจ chattr โจ
chattr [-R] [-v VERSION] [-p PROJID] [-+=AacDdijsStTu] FILE...
Change ext2 file attributes ๐ง
-Rโ recurse-v NUMโ set version/generation number-p NUMโ set project number
Modifiers:
-,+,=โ remove/add/set attributes
Attributes:
Aโ no atimeaโ append onlyCโ no copy-on-writecโ compressedDโ synchronous dir updatesdโ don't backup with dumpEโ encryptedeโ file uses extentsFโ case-insensitive dirIโ indexed diriโ immutablejโ write data to journal firstNโ file is stored in inodePโ hierarchical project ID dirSโ synchronous file updatessโ zero storage when deletedTโ top of dir hierarchytโ don't tail-merge with other filesuโ allow undeleteVโ verity
โจ chgrp โจ
chgrp [-RhLHPcvf]... GROUP FILE...
Change the group membership of FILEs to GROUP ๐ฏ
-hโ affect symlinks instead of symlink targets-Lโ traverse all symlinks to directories-Hโ traverse symlinks on command line only-Pโ don't traverse symlinks (default)-Rโ recurse-cโ list changed files-vโ verbose-fโ hide errors
โจ chmod โจ
chmod [-Rcvf] MODE[,MODE]... FILE...
MODE is an octal number (bit pattern sstrwxrwxrwx) or [ugoa]{+|-|=}[rwxXst] ๐ yes bestie you're setting permissions, main character energy
-Rโ recurse-cโ list changed files-vโ verbose-fโ hide errors
โจ chown โจ
chown [-RhLHPcvf]... USER[:[GRP]] FILE...
Change the owner and/or group of FILEs to USER and/or GRP ๐
-hโ affect symlinks instead of symlink targets-Lโ traverse all symlinks to directories-Hโ traverse symlinks on command line only-Pโ don't traverse symlinks (default)-Rโ recurse-cโ list changed files-vโ verbose-fโ hide errors
โจ chpasswd โจ
chpasswd [-me] [-c ALG] [-R DIR]
Read user:password from stdin and update /etc/passwd ๐
-eโ supplied passwords are in encrypted form-mโ encrypt usingmd5, notdes-c ALGโdes,md5,sha256/512,yescrypt(default )-R DIRโ directory to chroot into
โจ chroot โจ
chroot NEWROOT [PROG ARGS]
Run PROG with the root directory set to NEWROOT ๐
โจ chvt โจ
chvt N
Change the foreground virtual terminal to /dev/ttyN ๐บ
โจ clear โจ
clear
Clear the screen โจ squeaky clean, no thoughts, just blank
โจ cmp โจ
cmp [-l|s] [-n NUM] FILE1 [FILE2 [SKIP1 [SKIP2]]]
Compare FILE1 with FILE2 (or stdin) ๐
-lโ show decimal offset and octal byte value for differing bytes, and don't stop on the first mismatch-sโ quiet-n NUMโ compare at most NUM bytes
โจ cp โจ
cp [-arPLHpfinlsTu] SOURCE DEST
or:
cp [-arPLHpfinlsu] SOURCE... { -t DIRECTORY | DIRECTORY }
Copy SOURCEs to DEST ๐ iconic, essential, the way that
-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] [EXTR_FILE]...
Extract (-i) or list (-t) files from a cpio archive on stdin, or take a file list from stdin and create an archive (-o) ๐ฆ
Main operation mode:
-tโ list-iโ extract EXTR_FILEs (or all)-oโ create (requires-H newc)
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 ๐ข
โจ crond โจ
crond [-fbS] [-l N] [-L LOGFILE] [-c DIR]
-fโ foreground-bโ background (default)-Sโ log to syslog (default)-l Nโ set log level. Most verbose0, default8-L FILEโ log to FILE-c DIRโ cron dir. Default:/var/spool/cron/crontabs
โจ crontab โจ
crontab [-c DIR] [-u USER] [-ler]|[FILE]
-cโ crontab directory-uโ user-lโ list crontab-eโ edit crontab-rโ delete crontabFILEโ replace crontab by FILE (-: stdin)
โจ cttyhack โจ
cttyhack [PROG ARGS]
Give PROG a controlling tty if possible ๐ฅ๏ธ
Example for /etc/inittab (for busybox init):
::respawn:/bin/cttyhack /bin/sh
Giving controlling tty to shell running with PID 1:
$ exec cttyhack sh
Starting interactive shell from boot shell script:
setsid cttyhack sh
โจ cut โจ
cut {-b|c LIST | -f|F LIST [-d SEP] [-s]} [-D] [-O SEP] [FILE]...
Print selected fields from FILEs to stdout โ๏ธ
-b LISTโ output only bytes from LIST-c LISTโ output only characters from LIST-d SEPโ input field delimiter (default-fTAB,-Frun of whitespace)-f LISTโ print only these fields (-dis single char)-F LISTโ print only these fields (-dis regex)-sโ drop lines with no delimiter (else print them in full)-Dโ don't sort ranges; a line without delimiters has one field--output-delimiter SEPโ output field 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/-dTIME conversion-r FILEโ display last modification time of FILE-Rโ output RFC-2822 date-I[SPEC]โ output ISO-8601 dateSPEC=date(default),hours,minutes,secondsorns
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]
The 'date TIME' form accepts MMDDhhmm[[YY]YY][.ss] instead.
โจ dc โจ
dc [-x] [-eSCRIPT]... [-fFILE]... [FILE]...
Tiny RPN calculator ๐งฎ
Arithmetic: +, -, *, /, %, ^
~โ divide with remainder|โ modular exponentiationvโ square rootpโ print top of the stack without poppingfโ print entire stackkโ pop the value and set precisioniโ pop the value and set input radixoโ pop the value and set output radix
Examples: dc -e'2 2 + p' -> 4, dc -e'8 8 * 2 2 + / p' -> 16
โจ 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 ๐พ
if=FILEโ read from FILE instead of stdinof=FILEโ write to FILE instead of stdoutbs=Nโ read and write N bytes at a timeibs=Nโ read N bytes at a timeobs=Nโ write N bytes at a timecount=Nโ copy only N input blocksskip=Nโ skip N input blocksseek=Nโ skip N output blocksconv=notruncโ don't truncate output fileconv=noerrorโ continue after read errorsconv=syncโ pad blocks with zerosconv=fsyncโ physically write data out before finishingconv=swabโ swap every pair of bytesiflag=skip_bytesโskip=Nis in bytesiflag=count_bytesโcount=Nis in bytesoflag=seek_bytesโseek=Nis in bytesiflag=directโO_DIRECTinputoflag=directโO_DIRECToutputiflag=fullblockโ read full blocksoflag=appendโ open output in append modestatus=noxferโ suppress rate outputstatus=noneโ suppress all output
N may be suffixed by c (1), w (2), b (512), kB (1000), k (1024), MB, M, GB, G
โจ deallocvt โจ
deallocvt [N]
Deallocate unused virtual terminal /dev/ttyN ๐งน
โจ depmod โจ
depmod [-n] [-b BASE] [VERSION] [MODFILES]...
Generate modules.dep, alias, and symbols files ๐งฉ
-b BASEโ useBASE/lib/modules/VERSION-nโ dry run: print files to stdout
โจ devmem โจ
devmem ADDRESS [WIDTH [VALUE]]
Read/write from physical address ๐ง ๐
ADDRESSโ address to act uponWIDTHโ width (8/16/...)VALUEโ data to be written
โจ df โจ
df [-PkmhTai] [-B SIZE] [-t TYPE] [FILESYSTEM]...
Print filesystem usage statistics ๐
-Pโ POSIX output format-kโ 1024-byte blocks (default)-mโ 1M-byte blocks-hโ human readable (e.g.1K243M2G)-Tโ print filesystem type-t TYPEโ print only mounts of this type-aโ show all filesystems-iโ inodes-B SIZEโ blocksize
โจ diff โจ
diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2
Compare files line by line and output the differences between them. This implementation supports unified diffs only ๐ซ no cap.
-aโ treat every file like it's plain text, no binary panic allowed ๐-bโ ignore changes in the amount of whitespace (sohivshiis not the drama)-Bโ ignore changes whose lines are all blank-dโ try hard to find a smaller set of changes-iโ ignore case differences,Helloandhelloare the same girlie-Lโ use LABEL instead of the filename in the unified header-Nโ treat absent files as empty-qโ output only whether files differ, no essays-rโ recurse ๐-Sโ start with FILE when comparing directories-Tโ make tabs line up by prefixing a tab when necessary-sโ report when two files are the same-tโ expand tabs to spaces in output-Uโ output LINES lines of context-wโ ignore all whitespace, zero thoughts, blank mind โจ
dirname ๐
dirname FILENAME
Strip the non-directory suffix off FILENAME, aka "give me just the folder part bestie" ๐ซถ
dmesg ๐
dmesg [-cr] [-n LEVEL] [-s SIZE]
Print or control the kernel ring buffer โ the receipts of what your kernel has been up to ๐
-cโ clear the ring buffer after printing it-nLEVEL โ set console logging level-sSIZE โ buffer size-rโ print the raw message buffer
dos2unix ๐ชโก๏ธ๐ง
dos2unix [-ud] [FILE]
Convert FILE in-place from DOS format to Unix format. If you don't hand it a file, it uses stdin/stdout, no biggie.
-uโ dos2unix-dโ unix2dos
dpkg ๐ฆ
dpkg [-ilCPru] [-F OPT] PACKAGE
Install, remove and manage Debian packages. The whole package-management main character energy ๐
-i,--installโ install the package-l,--listโ list of installed packages--configureโ configure an unpackaged package-P,--purgeโ purge all files of a package-r,--removeโ remove all but the configuration files for a package--unpackโ unpack a package, but don't configure it--force-dependsโ ignore dependency problems (living dangerously, ngl)--force-confnewโ overwrite existing config files when installing--force-confoldโ keep old config files when installing
dpkg-deb ๐๏ธ
dpkg-deb [-cefxX] FILE [DIR]
Perform actions on Debian packages (.deb files) โ the little toolbox that pokes inside them ๐
-cโ list files-fโ print control fields-eโ extract control files to DIR (default:./DEBIAN)-xโ extract files to DIR (no default)-Xโ verbose extract
du ๐พ
du [-aHLdclsxhmk] [FILE]...
Summarize disk space used for *FILE*s (or directories). The "why is my disk full" detective ๐๐ญ
-aโ show file sizes too-bโ apparent size (including holes)-Lโ follow all symlinks-Hโ follow symlinks on command line-dN โ 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.,1K243M2G)-mโ sizes in megabytes-kโ sizes in kilobytes (default)
dumpkmap โจ๏ธ
dumpkmap > keymap
Print a binary keyboard translation table to stdout. Redirect it somewhere and it's yours ๐
dumpleases ๐
dumpleases [-r|-a] [-d] [-f LEASEFILE]
Display DHCP leases granted by udhcpd โ the guest list of who got an IP ๐๏ธ
-fFILE โ lease file-rโ show remaining time-aโ show expiration time-dโ show time in seconds
echo ๐ฃ๏ธ
echo [-neE] [ARG]...
Print *ARG*s to stdout. The people's princess of commands ๐
-nโ no trailing newline-eโ interpret backslash escapes (\t=tab etc)-Eโ don't interpret backslash escapes (default)
ed โ๏ธ
ed [-p PROMPT] [-s] [FILE]
That's literally all the page hands you here bestie โ just the synopsis, no description, no option list. We're keeping it exactly as it is ๐
env ๐
env [-i0] [-u NAME]... [-] [NAME=VALUE]... [PROG ARGS]
Print the current environment, or run PROG after setting up the environment for it ๐
-,-iโ start with an empty environment-0โ NUL terminated output-uNAME โ remove variable from environment
expand โก๏ธ๐
expand [-i] [-t N] [FILE]...
Convert tabs to spaces, writing to stdout. Glow-up for your whitespace โจ
-iโ don't convert tabs after non blanks-tโ tabstops every N chars
expr ๐งฎ
expr EXPRESSION
Print the value of EXPRESSION. Math o'clock, no calculator app required ๐ฅ
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
Heads up bestie ๐ข โ many operators need to be escaped or quoted for shells. Comparisons are arithmetic if both *ARG*s 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, or0.
factor ๐ข
factor [NUMBER]...
Print prime factors. Cracking numbers open like a lil safe ๐ฆ
fallocate ๐
fallocate [-o OFS] -l LEN FILE
Preallocate space for FILE โ reserving the vibes ahead of time ๐
-oOFS โ offset of range-lLEN โ length of range
fatattr ๐งท
fatattr [-+rhsvda] FILE...
Change file attributes on a FAT filesystem ๐
-โ clear attributes+โ set attributesrโ read onlyhโ hiddensโ systemvโ volume labeldโ directoryaโ archive
fdisk ๐ฝ
fdisk [-ul] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] [-t
PARTTYPE] DISK
Change the partition table. Very powerful, very "handle with care" โ ๏ธ
-uโ start and End are in sectors (instead of cylinders)-lโ show partition table for each DISK, then exit-b2048โ (for certain MO disks) use 2048-byte sectors-TPARTTYPE โ force'dos'partition if'gpt'also present-CCYLINDERS โ set number of cylinders/heads/sectors-HHEADS โ typically255-SSECTORS โ typically63
find ๐
find [-HL] [PATH]... [OPTIONS] [ACTIONS]
Search for files and perform actions on them. The first failed action stops processing of the current file. Defaults: PATH is the current directory, and the action is -print โจ
-L,-followโ follow symlinks-Hโ ...on command line only-xdevโ don't descend directories on other filesystems-maxdepthN โ descend at most N levels.-maxdepth 0applies actions to command line arguments only-mindepthN โ don't act on first N levels-depthโ act on directory after traversing it
Actions:
( ACTIONS )โ group actions for-o/-a! ACTโ invert ACT's success/failureACT1 [-a] ACT2โ if ACT1 fails, stop, else do ACT2ACT1 -o ACT2โ if ACT1 succeeds, stop, else do ACT2. Note:-ahas higher priority than-o-namePATTERN โ match file name (w/o directory name) to PATTERN-inamePATTERN โ case insensitive-name-pathPATTERN โ match path to PATTERN-ipathPATTERN โ case insensitive-path-regexPATTERN โ match path to regex PATTERN-typeX โ file type is X (one of:f,d,l,b,c,s,p)-executableโ file is executable-permMASK โ at least one mask bit (+MASK), all bits (-MASK), or exactly MASK bits are set in file's mode-mtimeDAYS โ mtime is greater than (+N), less than (-N), or exactly N days in the past-atimeDAYS โ atime+N/-N/Ndays in the past-ctimeDAYS โ ctime+N/-N/Ndays in the past-mminMINS โ mtime is greater than (+N), less than (-N), or exactly N minutes in the past-aminMINS โ atime+N/-N/Nminutes in the past-cminMINS โ ctime+N/-N/Nminutes in the past-newerFILE โ mtime is more recent than FILE's-inumN โ file has inode number N-samefileFILE โ file is same as FILE-userNAME/ID โ file is owned by given user-groupNAME/ID โ file is owned by given group-sizeN[bck]โ file size is N (c:bytes,k:kbytes,b:512 bytes (def.)).+/-N: file size is bigger/smaller than N-linksN โ number of links is greater than (+N), less than (-N), or exactly N-emptyโ match empty file/directory-pruneโ if current file is directory, don't descend into it
If none of the following actions is specified, -print is assumed ๐
-printโ print file name-print0โ print file name, NUL terminated-execCMD ARG;โ run CMD with all instances of{}replaced by file name. Fails if CMD exits with nonzero-execCMD ARG+โ run CMD with{}replaced by list of file names-okCMD ARG;โ prompt and run CMD with{}replaced-quitโ exit
findfs ๐งญ
findfs LABEL=label | UUID=uuid
Find the filesystem device based on label or UUID โ matching the name tag to the actual filesystem ๐ท๏ธ
fold ๐
fold [-bs] [-w WIDTH] [FILE]...
Wrap input lines in *FILE*s (or stdin), writing to stdout. Word-wrapping, but make it terminal ๐
-bโ count bytes rather than columns-sโ break at spaces-wโ use WIDTH columns instead of80
free ๐ง
free [-bkmgh]
Display free and used memory ๐
freeramdisk ๐
freeramdisk DEVICE
Free all memory used by the specified ramdisk
fsfreeze ๐ง
fsfreeze --[un]freeze MOUNTPOINT
Flush and halt writes to MOUNTPOINT โ pause the whole filesystem, respectfully โ๏ธ
fstrim ๐งน
fstrim [OPTIONS] MOUNTPOINT
-oOFFSET โ offset in bytes to discard from-lLEN โ bytes to discard-mMIN โ minimum extent length-vโ print number of discarded bytes
ftpget ๐ฅ
ftpget [OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE
Download a file via FTP ๐
-cโ continue previous transfer-vโ verbose-uUSER โ username-pPASS โ password-PPORT
ftpput ๐ค
ftpput [OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE
Upload a file to a FTP server
-vโ Verbose, babe ๐-uUSER โ the Username ๐ค-pPASS โ the Password ๐-PPORT โ the PORT ๐ช
โจ getfattr โจ
getfattr [-h] {-d|-n ATTR} FILE...
Get extended attributes โ all that extra metadata your files are hiding from you ๐
-hโ do not follow symlinks-dโ dump all the attributes, not a single one left behind ๐-nATTR โ get the attribute called ATTR
โจ getopt โจ
getopt [OPTIONS] [--] OPTSTRING PARAMS
-aโ allow long options that start with a single--lLOPT[,...] โ the long options to recognize-nPROGNAME โ the name under which errors are reported-oOPTSTRING โ the short options to recognize-qโ no error messages on unrecognized options-Qโ no normal output-sSHELL โ set shell quoting conventions-Tโ version test (exits with4)-uโ don't quote output
Example, bestie, here it is in all its chaotic glory:
O=`getopt -l bb: -- ab:c:: "$@"` || exit 1 eval set -- "$O" while true;
do case "$1" in -a) echo A; shift;; -b|--bb) echo
"B:'$2'"; shift 2;; -c) case "$2" in "") echo C; shift
2;; *) echo "C:'$2'"; shift 2;; esac;;
--) shift; break;; *) echo Error; exit 1;; esac done
โจ getty โจ
getty [OPTIONS] BAUD_RATE[,BAUD_RATE]... TTY [TERMTYPE]
Opens TTY, asks you for a login name, then calls /bin/login ๐ช๐ซ
-hโ enable hardware RTS/CTS flow control-Lโ set CLOCAL (ignore the Carrier Detect state)-mโ get the baud rate from the modem's CONNECT status message-nโ don't prompt for a login name-wโ wait for CR or LF before sending/etc/issue-iโ don't display/etc/issue-fISSUE_FILE โ display ISSUE_FILE instead of/etc/issue-lLOGIN โ invoke LOGIN instead of/bin/login-tSEC โ terminate after SEC if no login name is read-IINITSTR โ send INITSTR before anything else-HHOST โ log HOST into the utmp file as the hostname
BAUD_RATE of 0 leaves it unchanged, so hands off ๐ซถ
โจ grep โจ
grep [-HhnlLoqvsrRiwFEz] [-m N] [-A|B|C N] { PATTERN | -e PATTERN... |
-f FILE... } [FILE]...
Search for PATTERN in FILEs (or stdin, we love a pipe) ๐๐
-Hโ add thefilename:prefix-hโ do not add thefilename:prefix-nโ add theline_no:prefix-lโ show only the names of files that match-Lโ show only the names of files that don't match-cโ show only the count of matching lines-oโ show only the matching part of the line-qโ Quiet. Return0if PATTERN is found,1otherwise-vโ select non-matching lines-sโ suppress open and read errors-rโ recurse-Rโ recurse and dereference symlinks-iโ ignore case-wโ match whole words only-xโ match whole lines only-Fโ PATTERN is a literal (not a regexp)-Eโ PATTERN is an extended regexp-zโ NUL terminated input-mN โ match up to N times per file-AN โ print N lines of trailing context-BN โ print N lines of leading context-CN โ same as-A N -B N-ePTRN โ pattern to match-fFILE โ read pattern from file
โจ groups โจ
groups [USER]
Print the groups USER is in ๐ฏโ๏ธ
โจ 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] [-nfw]
Halt the system. Big main character shutdown energy ๐
-dSEC โ delay interval-nโ do not sync-fโ force (don't go through init)-wโ only write a wtmp record
โจ head โจ
head [OPTIONS] [FILE]...
Prints the first 10 lines of FILEs (or stdin). With more than one FILE, it puts a filename header in front of each one, so you know whose lines are whose ๐ท๏ธ
-n N[bkm]โ print first N lines-n -N[bkm]โ print all except the 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
โจ hexdump โจ
hexdump [-bcdoxCv] [-e FMT] [-f FMT_FILE] [-n LEN] [-s OFS] [FILE]...
Display FILEs (or stdin) in a format you choose ๐ข
-bโ 1-byte octal display-cโ 1-byte character display-dโ 2-byte decimal display-oโ 2-byte octal display-xโ 2-byte hex display-Cโ hex+ASCII, 16 bytes per line-vโ show all (no dup folding)-eFORMAT_STR โ example:'16/1 "%02x|""\n"'-fFORMAT_FILE-nLENGTH โ show only the first LENGTH bytes-sOFFSET โ skip OFFSET bytes
โจ hostid โจ
hostid
Print out a unique 32-bit identifier for the machine ๐โจ
โจ hostname โจ
hostname [-sidf] [HOSTNAME | -F FILE]
Show or set the hostname or the DNS domain name ๐
-sโ short-iโ addresses for the hostname-dโ DNS domain name-fโ fully qualified domain name-FFILE โ use FILE's content as the hostname
โจ httpd โจ
httpd [-ifv[v]] [-c CONFFILE] [-p [IP:]PORT] [-M MAXCONN] [-K KILLSEC]
[-u USER[:GRP]] [-r REALM] [-h HOME]
httpd -d/-e/-m STRING
Listen for incoming HTTP requests ๐๐
-iโ inetd mode-fโ run in foreground-v[v]โ verbose-p[IP:]PORT โ bind to IP:PORT (default*:80)-MNUM โ pause if NUM connections are open (default256)-KNUM โ kill CGIs after NUM seconds-uUSER[:GRP] โ set uid/gid after binding to port-rREALM โ Authentication Realm for Basic Authentication-hHOME โ home directory (default.)-cFILE โ configuration file (default{/etc,HOME}/httpd.conf)-mSTRING โ MD5 crypt STRING-eSTRING โ HTML encode STRING-dSTRING โ URL decode STRING
โจ hwclock โจ
hwclock [-ul] [-f DEV] [-s|-w|--systz|--param-get PARAM|--param-set
PARAM=VAL]
Show or set the hardware clock (RTC) โฐ
-fDEV โ use this device (e.g./dev/rtc2)-uโ assume the RTC is kept in UTC-lโ assume the RTC is kept in local time (if neither is given, read from/etc/adjtime)-sโ set system time from RTC-wโ set RTC from system time--systzโ set in-kernel timezone, correct system time if the RTC is kept in local time--param-getPARAM โ get RTC parameter--param-setPARAM=VAL โ set RTC parameter
โจ i2cdetect โจ
i2cdetect -l | -F I2CBUS | [-ya] [-q|-r] I2CBUS [FIRST LAST]
Detect I2C chips ๐๐ต๏ธโ๏ธ
-lโ list installed buses-FBUS# โ list functionalities on this bus-yโ disable interactive mode-aโ force scanning of non-regular addresses-qโ use smbus quick write commands for probing (default)-rโ use smbus read byte commands for probing
FIRST and LAST limit the probing range ๐ฏ
โจ i2cdump โจ
i2cdump [-fy] [-r FIRST-LAST] BUS ADDR [MODE]
Examine I2C registers ๐ฌ
- I2CBUS โ I2C bus number
- ADDRESS โ
0x03-0x77
MODE is:
bโ Byte (default)wโ WordWโ Word on even register addressesiโ I2C blocksโ SMBus blockcโ Consecutive byte
Append p for SMBus PEC โจ
-fโ force access-yโ disable interactive mode-rโ limit the number of registers being accessed
โจ i2cget โจ
i2cget [-fy] BUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]
Read from I2C/SMBus chip registers ๐
- I2CBUS โ I2C bus number
- ADDRESS โ
0x03-0x77
MODE is:
bโ read byte data (default)wโ read word datacโ write byte/read byte
Append p for SMBus PEC โจ
-fโ force access-yโ disable interactive mode
โจ i2cset โจ
i2cset [-fy] [-m MASK] BUS CHIP-ADDRESS DATA-ADDRESS [VALUE] ... [MODE]
Set I2C registers โ๏ธ
- I2CBUS โ I2C bus number
- ADDRESS โ
0x03-0x77
MODE is:
cโ byte, no valuebโ byte data (default)wโ word dataiโ I2C block datasโ SMBus block data
Append p for SMBus PEC โจ
-fโ force access-yโ disable interactive mode-rโ read back and compare the result-mMASK โ mask specifying which bits to write
โจ i2ctransfer โจ
i2ctransfer [-fay] I2CBUS { rLENGTH[@ADDR] | wLENGTH[@ADDR] DATA...}...
Read/write I2C data in one single transfer, efficiency icon ๐
-fโ force access to busy addresses-aโ force access to non-regular addresses-yโ disable interactive mode
โจ id โจ
id [-ugGnr] [USER]
Print info about USER, or about the current user if you don't name one ๐ชช
-uโ user ID-gโ group ID-Gโ supplementary group IDs-nโ print names instead of numbers-rโ print real ID instead of effective ID
โจ ifconfig โจ
ifconfig [-a] [IFACE] [ADDRESS]
Configure a network interface ๐ ๏ธ๐
[add ADDRESS[/PREFIXLEN]]
[del ADDRESS[/PREFIXLEN]]
[[-]broadcast [ADDRESS]] [[-]pointopoint [ADDRESS]]
[netmask ADDRESS] [dstaddr ADDRESS]
[outfill NN] [keepalive NN]
[hw ether|infiniband ADDRESS] [metric NN] [mtu NN]
[[-]trailers] [[-]arp] [[-]allmulti]
[multicast] [[-]promisc] [txqueuelen NN] [[-]dynamic]
[mem_start NN] [io_addr NN] [irq NN]
[up|down] ...
โจ ifdown โจ
ifdown [-nmvf] [-i FILE] -a | IFACE...
-aโ deconfigure all interfaces-iFILE โ use FILE instead of/etc/network/interfaces-nโ dry run (note: doesn't disable mappings)-mโ don't run any mappings-vโ print out what would happen before doing it-fโ force
โจ ifup โจ
ifup [-nmvf] [-i FILE] -a | IFACE...
-aโ sets up (or brings down) every single interface at once. all of them. the whole roster. ๐-i FILEโ use FILE instead of the usual/etc/network/interfaces. gotta have options bestie โจ-nโ dry run! nothing actually happens. (heads up tho: this doesn't disable mappings, so likeโฆ be aware ๐ซ )-mโ don't run any mappings. nope, not one.-vโ prints out what would happen before it happens. little preview moment ๐-fโ force it. ๐
๐ธ init ๐ธ
init
Ok so init is the literal first process started during boot. It never exits. Like ever. She's the main character and she's here to stay ๐
What she does: (re)spawns children according to /etc/inittab. god tier parenting fr fr.
Signals, and what they make her do:
- HUP: reload
/etc/inittab - TSTP: stop respawning until CONT
- QUIT: re-exec another init
- USR1/TERM/USR2/INT: run the halt/reboot/poweroff/Ctrl-Alt-Del script ๐ฆ
๐ insmod ๐
insmod FILE [SYMBOL=VALUE]...
Loads a kernel module. that's it, that's the whole vibe ๐ง
๐ install ๐
install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [-t DIR] [SOURCE]... DEST
Copies files and sets their attributes, all in one glow-up โจ
-cโ just copy (this is the default, no thoughts head empty)-dโ create directories-Dโ create the leading target directories too-sโ strip the symbol table-pโ preserve date-o USERโ set ownership-g GRPโ set group ownership-m MODEโ set permissions-t DIRโ install to DIR
๐ ionice ๐
ionice [-c 1-3] [-n 0-7] [-t] { -p PID | PROG ARGS }
Changes I/O priority and class. aka telling your disk reads to take a chill pill ๐
-c Nโ class.1:realtime2:best-effort3:idle-n Nโ priority-tโ ignore errors
โญ ip โญ
ip [OPTIONS] address|route|link|tunnel|neigh|rule [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] [type TYPE ARGS]
ip tunnel add|change|del|show [NAME]
[mode ipip|gre|sit] [remote ADDR] [local ADDR] [ttl TTL]
ip neigh show|flush [to PREFIX] [dev DEV] [nud STATE]
ip rule [list] | add|del SELECTOR ACTION
the networking Swiss army knife. lowkey does everything ๐
๐ฆ ipcalc ๐ฆ
ipcalc [-bnmphs] ADDRESS[/PREFIX] [NETMASK]
Calculates and displays network settings straight from an IP address. math but make it cute ๐
-bโ broadcast address-nโ network address-mโ default netmask for the IP-pโ prefix for IP/NETMASK-hโ resolved host name-sโ no error messages ๐
๐ kill ๐
kill [-l] [-SIG] PID...
Sends a signal (default: TERM) to the given PIDs. the classic "please stop" โ
-lโ list all signal names and numbers
๐ฅ killall ๐ฅ
killall [-lq] [-SIG] PROCESS_NAME...
Sends a signal (default: TERM) to the given processes โ by name, bestie, not by number ๐ค
-lโ list all signal names and numbers-qโ don't complain if no processes got killed. sometimes nothing happens and that's fine ๐
๐ธ klogd ๐ธ
klogd [-c N] [-n]
Logs kernel messages to syslog. the kernel's diary, essentially ๐
-c Nโ print to console the messages more urgent than prio N (1-8)-nโ run in foreground
๐ซถ last ๐ซถ
last
Shows a listing of the last users that logged into the system. receipts of who was here ๐
โจ less โจ
less [-EFIMmNSRh~] [FILE]...
Views FILE (or stdin) one screenful at a time. the scrolling icon we all deserve ๐
-Eโ quit once the end of a file is reached-Fโ quit if the entire file fits on the first screen-Iโ ignore case in all searches-M,-mโ display a status line with line numbers and percentage through the file-Nโ prefix a line number to each line-Sโ truncate long lines-Rโ remove color escape codes in input-~โ suppress the~s displayed past EOF
๐ link ๐
link FILE LINK
Creates a hard LINK to FILE. permanent commitment fr ๐
๐ ln ๐
ln [-sfnbtv] [-S SUF] TARGET... LINK|DIR
Creates a link LINK or DIR/TARGET to the specified TARGET(s)
-sโ make symlinks instead of hardlinks-fโ remove existing destinations-nโ don't dereference symlinks โ treat like a normal file-bโ make a backup of the target (if it exists) before the link operation-S SUFโ use SUF as the suffix instead of~when making backup files-Tโ treat LINK as a file, not a DIR-vโ verbose
๐ loadfont ๐
loadfont < font
Loads a console font from stdin. slay your terminal's whole look ๐ฆ
โญ loadkmap โญ
loadkmap < keymap
Loads a binary keyboard translation table from stdin โจ๏ธ
๐ logger ๐
logger [-s] [-t TAG] [-p PRIO] [MESSAGE]
Writes MESSAGE (or stdin) to syslog
-sโ log to stderr as well as the system log-t TAGโ log using the specified tag (defaults to your user name)-p PRIOโ priority (a number, or aFACILITY.LEVELpair)
๐ login ๐
login [-p] [-h HOST] [[-f] USER]
Begins a new session on the system. the glow-up from "who?" to "user" โจ
-fโ don't authenticate (the user is already authenticated)-h HOSTโ the host the user came from (for network logins)-pโ preserve environment
$LOGIN_TIMEOUT โ seconds (default 60, 0 disables it)
๐ธ logname ๐ธ
logname
Prints the name of the current user. who am I? yes ๐
๐ง logread ๐ง
logread [-fF]
Shows the messages in syslogd's circular buffer
-fโ output data as the log grows-Fโ same as-f, but dump the buffer first
๐ losetup ๐
losetup [-rP] [-o OFS] {-f|LOOPDEV} FILE: associate loop devices
losetup -c LOOPDEV: reread file size
losetup -d LOOPDEV: disassociate
losetup -a: show status
losetup -f: show next free loop device
-o OFSโ start OFS bytes into FILE-Pโ scan for partitions-rโ read-only-fโ show/use the next free loop device
โจ ls โจ
ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]...
Lists directory contents. the moment. the icon. the blueprint ๐
-1โ one column output-aโ include names starting with.-Aโ like-a, but exclude.and..-xโ list by lines-dโ list directory names, not contents-Lโ follow symlinks-Hโ follow symlinks on the command line-Rโ recurse-pโ append/to directory names-Fโ append indicator (one of*/=@|) to names-lโ long format-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 (1K243M2G)--group-directories-firstโ directories first, obviously ๐-Sโ sort by size-Xโ sort by extension-vโ sort by version-tโ sort by mtime-tcโ sort by ctime-tuโ sort by atime-rโ reverse sort order-w Nโ format N columns wide--color[={always,never,auto}]โ the colorsss ๐
๐ lsattr ๐
lsattr [-Radlpv] [FILE]...
Lists ext2 file attributes
-Rโ recurse-aโ include names starting with.-dโ list directory names, not contents-lโ list long flag names-pโ list project ID-vโ list version/generation number
๐ฆ lsblk ๐ฆ
lsblk [BLOCKDEV]...
Lists block devices. the whole storage family tree ๐ณ
โญ lsmod โญ
lsmod
Lists loaded kernel modules
๐ธ lzcat ๐ธ
lzcat [FILE]...
Decompresses to stdout
๐ lzma ๐
lzma -d [-cfk] [FILE]...
Decompresses *FILE*s (or stdin)
-dโ decompress-cโ write to stdout-fโ force-kโ keep input files-tโ test integrity
๐ฅ lzop ๐ฅ
lzop [-cfUvd123456789CF] [FILE]...
-1..9โ compression level-dโ decompress-cโ write to stdout-fโ force-Uโ delete input files-vโ verbose-Fโ don't store or verify checksum-Cโ also write checksum of compressed block
๐ md5sum ๐
md5sum [-c[sw]] [FILE]...
Prints or checks MD5 checksums
-cโ check sums against the list in *FILE*s-sโ don't output anything, the status code shows success-wโ warn about improperly formatted checksum lines
๐ง mdev ๐ง
mdev [-vS] { [-s] | [-df] }
-vโ verbose-Sโ log to syslog too-sโ scan/sysand 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 like
[-][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 the /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 the /dev/mdev.log file exists, the debug log will be appended to it.
๐ microcom ๐
microcom [-d DELAY_MS] [-t TIMEOUT_MS ] [-s SPEED] [-X] TTY
Copies bytes from stdin to TTY and from TTY to stdout
-d DELAYโ wait up to DELAY ms for TTY output before sending every next byte to it-t TIMEOUTโ exit if both stdin and TTY are silent for TIMEOUT ms-s SPEEDโ set the serial line to SPEED-Xโ disable the special meaning of NUL and Ctrl+X from stdin
๐ mim ๐
mim [-f FILE] [SHELL_OPTIONS] [TARGET] ...
Runs a script from a Makefile-like specification file
-f FILEโ spec file (defaultMimfile)
๐ mkdir ๐
mkdir [-m MODE] [-p] DIRECTORY...
Creates DIRECTORY
-m MODEโ mode-pโ no error if it exists; make parent directories as needed
๐ mkdosfs ๐
mkdosfs [-v] [-n LABEL] BLOCKDEV [KBYTES]
Makes a FAT32 filesystem
-vโ verbose-n LBLโ volume label
๐ mke2fs ๐
mke2fs [-Fn] [-b BLK_SIZE] [-i INODE_RATIO] [-I INODE_SIZE] [-m RESERVED_PERCENT] [-L LABEL] BLOCKDEV [KBYTES]
-b BLK_SIZEโ block size, in bytes-Fโ force-i RATIOโ max number of files isfilesystem_size / RATIO-I BYTESโ inode size (min128)-L LBLโ volume label-m PERCENTโ percent of blocks to reserve for admin-nโ dry run
๐ฆ mkfifo ๐ฆ
mkfifo [-m MODE] NAME
Creates a named pipe
-m MODEโ mode (defaulta=rw)
โญ mknod โญ
mknod [-m MODE] NAME TYPE [MAJOR MINOR]
Creates a special file (block, character, or pipe)
-m MODEโ creation mode (defaulta=rw)
TYPE:
bโ block devicecoruโ character devicepโ named pipe (MAJOR MINORmust be omitted)
๐ซถ mkpasswd ๐ซถ
mkpasswd [-P FD] [-m TYPE] [-S SALT] [PASSWORD] [SALT]
Prints a crypt(3) hashed PASSWORD
-P Nโ read the password from fd N-m TYPEโdes,md5,sha256/512,yescrypt(default )-S SALTโ ๐
๐ mkswap
mkswap [-L LBL] BLOCKDEV [KBYTES]
Get BLOCKDEV all dressed up to be used as a swap partition โจ like, it's being given its whole swap-era glow-up.
-L LBLโ slap aLBLlabel on it, cute little name tag ๐
๐ mktemp
mktemp [-dt] [-p DIR] [TEMPLATE]
Okay so this one makes a temporary file with a name based on TEMPLATE and then prints that name back at you. And listen โ TEMPLATE must end with XXXXXX (like, for real, e.g. [/dir/]nameXXXXXX). If you're feeling lazy and don't give it a TEMPLATE, it just assumes -t tmp.XXXXXX.
-dโ make a directory instead of a file-qโ fail silently if something goes wrong (no dramatic exit)-tโ prepend the base directory name toTEMPLATE-p DIRโ useDIRas the base directory (and yes, this implies-t)-uโ don't actually create anything, just print a name
The base directory goes like: -p DIR, otherwise $TMPDIR, otherwise /tmp. That's the hierarchy bestie ๐
๐ 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โ the keyword to look for-0โ NUL terminated output
๐ modprobe
modprobe [-alrqvsDb] MODULE [SYMBOL=VALUE]...
-aโ load multipleMODULEs-lโ list (and hereMODULEis a pattern, not a literal)-rโ removeMODULE(stacks) or do an autoclean-qโ quiet, shhh-vโ verbose, tell me everything-sโ log to syslog-Dโ show dependencies-bโ apply blacklist to module names too
๐ more
more [FILE]...
View FILE (or stdin) one screenful at a time ๐ฆ classic, iconic, no notes.
๐ mount
mount [OPTIONS] [-o OPT] DEVICE NODE
Mount a filesystem. Heads up: filesystem autodetection requires /proc ๐ so don't come crying if you skipped that.
-aโ mount all filesystems in fstab-fโ dry run (pretend, but make it fashion)-iโ don't run the mount helper-rโ read-only mount-t FSTYPE[,...]โ filesystem type(s)-T FILEโ readFILEinstead of/etc/fstab-O OPTโ mount only filesystems with optionOPT(-aonly)
And then the -o OPT universe opens up โจ:
loopโ ignored (loop devices are autodetected, so, like, pointless but okay)[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 locationmoveโ relocate an existing mount pointremountโ remount a mounted filesystem, changing flagsroโ same as-r
There are also filesystem-specific -o flags, so like, check your fave filesystem's own lore ๐ซถ
๐ mt
mt [-f DEVICE] OPCODE VALUE
Control magnetic tape drive operation ๐๏ธ yes we still do tapes, it's vintage-core.
Opcodes, the full roster: bsf bsfm bsr bss datacompression drvbuffer eof eom erase fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2 ras3 reset retension rewind rewoffline seek setblk setdensity setpart tell unload unlock weof wset
๐ mv
mv [-finT] SOURCE DEST
or: mv [-fin] SOURCE... { -t DIRECTORY | DIRECTORY }
Rename SOURCE to DEST, or move SOURCEs to DIRECTORY. The classic glow-up + relocation package ๐
-fโ don't prompt before overwriting (bold, no hesitation)-iโ interactive, prompt before overwrite (so polite)-nโ don't overwrite an existing file-Tโ refuse to move ifDESTis a directory-t DIRโ move allSOURCEs intoDIR
๐ nameif
nameif [-s] [-c FILE] [IFNAME HWADDR]...
Rename a network interface while it's in the down state ๐ The device with address HWADDR gets renamed to IFNAME.
-c FILEโ configuration file (default:/etc/mactab)-sโ log to syslog
๐ nbd-client
nbd-client { [-b BLKSIZE] [-N NAME] [-t SEC] [-p] HOST [PORT] | -d } BLOCKDEV
Connect to HOST and provide a network block device on BLOCKDEV ๐ like, block devices but networked, iykyk.
๐ nc
nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG]
Open a pipe to IP:PORT or FILE.
-lโ listen mode, for inbound connects (and psst, use-llwith-efor a persistent server ๐)-p PORTโ local port-w SECโ connect timeout-i SECโ delay interval for lines sent-f FILEโ use file (ala/dev/ttyS0) instead of network-e PROGโ runPROGafter connect
๐ netstat
netstat [-ral] [-tuwx] [-en]
Display networking information, the og vibe check on your sockets ๐
-rโ routing table-aโ all sockets-lโ listening sockets, otherwise: connected sockets-tโ TCP sockets-uโ UDP sockets-wโ raw sockets-xโ Unix sockets, otherwise: all socket types-eโ other/more information-nโ don't resolve names
๐ nl
nl [OPTIONS] [FILE]...
Write FILEs to standard output with line numbers added ๐ข
-b STYLEโ which lines to number:a: all,t: nonempty,n: none-i Nโ line number increment-s STRINGโ useSTRINGas line number separator-v Nโ start fromN-w Nโ width of line numbers
๐ nohup
nohup PROG ARGS
Run PROG immune to hangups, with output going to a non-tty ๐ช like, your process simply cannot be hangup-ed, periodt.
๐ nologin
nologin
Politely refuse a login ๐ โโ๏ธ it's giving velvet rope energy, but make it courteous.
๐ nproc
nproc [--all] [--ignore=N]
Print number of available CPUs ๐ง
--allโ number of installed CPUs--ignore=Nโ excludeNCPUs
๐ nsenter
nsenter [OPTIONS] [PROG ARGS]
-t PIDโ target process to get namespaces from-m[FILE]โ enter mount namespace-u[FILE]โ enter UTS namespace (hostname etc)-i[FILE]โ enter System V IPC namespace-n[FILE]โ enter network namespace-p[FILE]โ enter pid namespace-U[FILE]โ enter user namespace-S UIDโ set uid in entered namespace-G GIDโ set gid in entered namespace--preserve-credentialsโ don't touch uids or gids-r[DIR]โ set root directory-w[DIR]โ set working directory-Fโ don't fork before exec'ingPROG
๐ nslookup
nslookup [-type=QUERY_TYPE] [-debug] HOST [DNS_SERVER]
Query DNS about HOST ๐
QUERY_TYPE: soa,ns,a,aaaa,cname,mx,txt,ptr,srv,any
๐ nuke
nuke DIR...
Remove DIRs ๐ dramatic name, exactly what it says.
๐ od
od [-abcdfhilovxs] [-t TYPE] [-A RADIX] [-N SIZE] [-j SKIP] [-S MINSTR] [-w WIDTH] [FILE]...
Print FILEs (or stdin) unambiguously, as octal bytes by default ๐ข
๐ openvt
openvt [-c N] [-sw] [PROG ARGS]
Start PROG on a new virtual terminal ๐ฅ๏ธ
-c Nโ use specified VT-sโ switch to the VT-wโ wait forPROGto exit
๐ partprobe
partprobe DEVICE...
Ask kernel to rescan partition table ๐ like, kernel bestie, pls take another look.
๐ passwd
passwd [-a ALG] [-dlu] [USER]
Change USER's password (default: current user) ๐
-a ALGโdes,md5,sha256/512,yescrypt(default )-dโ set password to''-lโ lock (disable) account-uโ unlock (enable) account
๐ paste
paste [-d LIST] [-s] [FILE]...
Paste lines from each input file, separated with tab โจ
-d LISTโ use delimiters fromLIST, not tab-sโ serial: one file at a time
๐ patch
patch [-RNE] [-p N] [-i DIFF] [ORIGFILE [PATCHFILE]]
-p Nโ stripNleading components from file names-i DIFFโ readDIFFinstead of stdin-Rโ reverse patch-Nโ ignore already applied patches-Eโ remove output files if they become empty--dry-runโ don't actually change files
๐ pidof
pidof [NAME]...
List PIDs of all processes with names that match NAMEs ๐ฏ
๐ ping
ping [OPTIONS] HOST
Send ICMP ECHO_REQUESTs to HOST ๐
-4,-6โ force IP or IPv6 name resolution-c CNTโ send onlyCNTpings-s SIZEโ sendSIZEdata bytes in packets (default56)-i SECSโ interval-Aโ ping as soon as reply is received-t TTLโ set TTL-I IFACE/IPโ source interface or IP address-W SECโ seconds to wait for the first response (default10) (after all-c CNTpackets are sent)-w SECโ seconds until ping exits (default: infinite) (can exit earlier with-c CNT)-qโ quiet, only display output at start/finish-p HEXBYTEโ payload pattern
๐ ping6
ping6 [OPTIONS] HOST
Send ICMP ECHO_REQUESTs to HOST ๐
-c CNTโ send onlyCNTpings-s SIZEโ sendSIZEdata bytes in packets (default56)-i SECSโ interval-Aโ ping as soon as reply is received-I IFACE/IPโ source interface or IP address-W SECโ seconds to wait for the first response (default10) (after all-c CNTpackets are sent)-w SECโ seconds until ping exits (default: infinite) (can exit earlier with-c CNT)-qโ quiet, only display output at start/finish-p HEXBYTEโ payload pattern
๐ pivot_root
pivot_root NEW_ROOT PUT_OLD
Move the current root file system to PUT_OLD and make NEW_ROOT the new root file system ๐ glow-up but for your entire filesystem hierarchy.
๐ 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)
๐ printf
printf FORMAT [ARG]...
Format and print ARG(s) according to FORMAT (a-la C printf) ๐
๐ 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 ๐
๐ rdate
rdate [-s/-p] HOST
Set and print time from HOST using RFC 868 โฐ
-sโ only set system time-pโ only print time
๐ readlink
readlink [-fnv] FILE
Display the value of a symlink ๐
-nโ don't add newline-fโ canonicalize by following all symlinks-vโ verbose
๐ realpath
realpath FILE...
Print absolute pathnames of FILEs ๐
๐ reboot
reboot [-d DELAY] [-nf]
Reboot the system ๐
-d SECโ delay interval-nโ do not sync-fโ force (don't go through init)
๐ renice
renice [-n] PRIORITY [[-p|g|u] ID...]...
...and if you wanna tweak a process that's already running, here's how you do it ๐
-nโ add PRIORITY to the current nice value. Heads up: if you don't pass-n, the nice value gets set straight to PRIORITY. No adding, just vibes being replaced.-pโ treat the args as process ids (this is the default, lowkey the main character)-gโ treat the args as process group ids-uโ treat the args as process user names
reset
reset
Bestie, this one clears the slate: it resets the terminal (ESC codes) and termios (signals, buffering, echo). Your terminal said "I'm normal again", periodt. ๐ซถ
resize
resize
Resize the screen. That's the whole thing. It's giving exactly what it says on the tin. โจ
resume
resume BLOCKDEV [OFFSET]
Restore system state from the suspend-to-disk data sitting in BLOCKDEV. Napping process, wake up ๐ฆ
rev
rev [FILE]...
Reverse the lines of FILE. Your file goes backwards, no cap. ๐
rm
rm [-irf] FILE...
Remove (unlink) your FILEs. It's the classic.
-iโ always prompt before removing (safety bestie ๐ฅบ)-fโ never prompt (feral mode ๐)-R,-rโ recurse. This deletes things recursively so pls be careful, this one has ruined lives fr fr
rmdir
rmdir [-p] DIRECTORY...
Remove DIRECTORY โ but only if it's empty. It will not help you commit crimes.
-pโ include parents (yeet the whole chain upward if they're all empty)--ignore-fail-on-non-emptyโ does exactly what it says, doesn't throw a fit when the dir has stuff in it ๐
rmmod
rmmod [-wfa] [MODULE]...
Unload kernel modules. Bye bestie, you served ๐ซก
-wโ wait until the module is no longer used-fโ force unload (dramatic, use wisely)-aโ remove all unused modules (recursively)
route
route [-ne] [-A inet[6]] [{add|del} [-net|-host] TARGET [netmask MASK]
[gw GATEWAY] [metric N] [mss BYTES] [window BYTES] [reject]
[IFACE]]
Show or edit the kernel routing tables. This is the map of how your packets get places ๐บ๏ธโจ
-nโ don't resolve names (just give me the numbers, I'm in a hurry)-eโ display other/more info-A inet[6]โ select the address family
rpm
rpm -i PACKAGE.rpm; rpm -qp[ildc] PACKAGE.rpm
Manipulate RPM packages. The commands are:
-iโ install the package-qpโ query the package-qpiโ show information-qplโ list contents-qpdโ list documents-qpcโ list config files
rpm2cpio
rpm2cpio PACKAGE.rpm
Outputs a cpio archive of the rpm file. Simple as that, one job, ate ๐
run-init
run-init [-d CAP,CAP...] [-n] [-c CONSOLE_DEV] NEW_ROOT NEW_INIT [ARGS]
Free the initramfs and switch to another root fs. So what happens is: chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, execute NEW_INIT. Major main character energy โ and also: PID must be 1, and NEW_ROOT must be a mountpoint. No exceptions bestie.
-c DEVโ reopen stdio to DEV after the switch-d CAPSโ drop capabilities-nโ dry run
run-parts
run-parts [-a ARG]... [-u UMASK] [--reverse] [--test] [--exit-on-error]
DIRECTORY
Run a whole bunch of scripts in DIRECTORY. Group project, but make it functional ๐
-a ARGโ pass ARG as an argument to the scripts-u UMASKโ set UMASK before running the scripts--reverseโ reverse execution order--testโ dry run--exit-on-errorโ bail out if a script exits with non-zero
sed
sed [-i[SFX]] [-nrE] [-f FILE]... [-e CMD]... [FILE]... or: sed
[-i[SFX]] [-nrE] CMD [FILE]...
The stream editor. Iconic. Legendary. Absolute queen of text munging ๐
-e CMDโ add CMD to the sed commands to be executed-f FILEโ add FILE contents to the sed commands to be executed-i[SFX]โ edit files in-place (otherwise it writes to stdout). Optionally backs files up, appending SFX-nโ suppress automatic printing of the pattern space-r,-Eโ use extended regex syntax
If there's no -e or -f, then the first non-option argument is the sed command string. The remaining arguments are input files (or stdin if there aren't any).
seq
seq [-w] [-s SEP] [FIRST [INC]] LAST
Print numbers from FIRST to LAST, in steps of INC. Both FIRST and INC default to 1.
-wโ pad with leading zeros-s SEPโ string separator
setkeycodes
setkeycodes { SCANCODE KEYCODE }...
Modify the kernel's scancode-to-keycode map, which is how you let unusual keyboards generate usable keycodes. Inclusive of weird hardware ๐
SCANCODE is either xx or e0xx (hexadecimal), and KEYCODE is decimal.
setpriv
setpriv [OPTIONS] PROG ARGS
Run PROG with different privilege settings.
-d,--dumpโ show current capabilities--nnp,--no-new-privsโ ignore setuid/setgid bits and file capabilities--inh-caps CAP,CAPโ set inheritable capabilities--ambient-caps CAP,CAPโ set ambient capabilities
setsid
setsid [-c] PROG ARGS
Run PROG in a new session. PROG will have no controlling terminal and won't be affected by keyboard signals (^C etc). Untouchable. Unbothered. In its own lane ๐ง
-cโ set controlling terminal to stdin
sh
sh [-il] [-|+Cabefmnuvx] [-|+o OPT]... [-c 'SCRIPT' [ARG0 ARGS] | FILE
ARGS | -s ARGS]
The Unix shell interpreter. Yeah that's it, that's the whole description, it needs no hype, it is the hype ๐ญ
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
sha384sum
sha384sum [-c[sw]] [FILE]...
Print or check SHA384 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(which is the 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
shred
shred [-fuz] [-n N] [-s SIZE] FILE...
Overwrite/delete your FILEs. This is the "I want it GONE gone" one ๐ซฃ๐ฅ
-fโ chmod to ensure writability-s SIZEโ size to write-n Nโ overwrite N times (default3)-zโ final overwrite with zeros-uโ remove the file
shuf
shuf [-n NUM] [-o FILE] [-z] [FILE | -e [ARG...] | -i L-H]
Randomly permute lines. Chaos, but on purpose ๐
-n NUMโ output at most NUM lines-o FILEโ write to FILE, not standard output-zโ NUL terminated output-eโ treat the ARGs as lines-i L-Hโ treat the numbers L-H as lines
sleep
sleep [N]...
Pause for a time equal to the total of the args you gave, where each arg can have an optional suffix of s for seconds, m for minutes, h for hours, or d for days. Bestie needs her beauty rest ๐ด๐ค
sort
sort [-nrughMcszbdfiokt] [-o FILE] [-k
START[.OFS][OPTS][,END[.OFS][OPTS]] [-t CHAR] [FILE]...
Sort lines of text. The organizing queen, she puts your whole life in order โจ
-o FILEโ output to FILE-cโ check whether the input is sorted-bโ ignore leading blanks-fโ ignore case-iโ ignore unprintable characters-dโ dictionary order (blank or alphanumeric only)-nโ sort numbers-gโ general numerical sort-hโ sort human readable numbers (2K 1G)-Mโ sort month-Vโ sort version-t CHARโ field separator-k N[,M]โ sort by the Nth field-rโ reverse sort order-sโ stable (don't sort ties alphabetically)-uโ suppress duplicate lines-zโ NUL terminated input and output
ssl_client
ssl_client [-n SNI] { -s FD [-r FD] | HOST | -e PROG ARGS }
That's the synopsis, that's the whole entry. No extra notes in the source, so no extra notes from me ๐
ssl_server
ssl_server -f PRIVKEY_CERT.pem PROG ARGS
An inetd-style TLS server.
-f PEMFILEโ HAProxy-style CRT file
start-stop-daemon
start-stop-daemon -S|-K [OPTIONS] [-- ARGS]
Search for matching processes, and then -S starts a process unless a matching process is found, or -K stops all matching processes. She's doing both jobs and not complaining about it ๐
Process matching:
-u USERNAME|UIDโ match only this user's processes-n NAMEโ match processes with NAME in the comm field in/proc/PID/stat-x EXECUTABLEโ match processes with this command in/proc/PID/cmdline-p FILEโ match a process with the PID from FILE- All specified conditions must match
-S only:
-x EXECUTABLEโ program to run-a NAMEโ zeroth argument-bโ background-O FILEโ append stdout and stderr to FILE-N Nโ change nice level-c USER[:[GRP]]โ change user/group-d DIRโ change to DIR-mโ write PID to the pidfile specified by-p
-K only:
-s SIGโ signal to send-tโ match only, exit with 0 if found
Other:
-oโ exit with status 0 if nothing is done-vโ verbose-qโ quiet
stat
stat [-ltf] [-c FMT] FILE...
Display file status (the default) or filesystem status.
-c FMTโ use the specified format-fโ display filesystem status-Lโ follow links-tโ terse display
FMT sequences for files:
%aโ access rights in octal%Aโ access rights in human readable form%bโ number of blocks allocated (see%B)%Bโ size in bytes of each block reported by%b%dโ device number in decimal%Dโ device number in hex%fโ raw mode in hex%Fโ file type%gโ group ID%Gโ group name%hโ number of hard links%iโ inode number%nโ file name%Nโ file name, with-> TARGETif symlink%oโ I/O block size%sโ total size in bytes%tโ major device type in hex%Tโ minor device type in hex%uโ user ID%Uโ user name%xโ time of last access%Xโ time of last access as seconds since Epoch%yโ time of last modification%Yโ time of last modification as seconds since Epoch%zโ time of last change%Zโ time of last change as seconds since Epoch
FMT sequences for file systems:
%aโ free blocks available to non-superuser%bโ total data blocks%cโ total file nodes%dโ free file nodes%fโ free blocks%iโ File System ID in hex%lโ maximum length of filenames%nโ file name%sโ block size (for faster transfer)%Sโ fundamental block size (for block counts)%tโ type in hex%Tโ type in human readable form
strings
strings [-fo] [-t o|d|x] [-n LEN] [FILE]...
Display printable strings in a binary file. Digging the little readable bits out of the chaos ๐โจ
-fโ precede strings with filenames-oโ precede strings with octal offsets-t o|d|xโ precede strings with offsets in base 8/10/16-n LENโ at least LEN characters form a string (default4)
stty
stty [-a|g] [-F DEVICE] [SETTING]...
With no arguments, it prints the baud rate, the line discipline, and the deviations from stty sane.
-F DEVICEโ open DEVICE instead of stdin ๐ซถ-aโ print every current setting in human-readable form, so you can actually read it bestie-gโ print it instty-readable form instead (for feeding right back in)[SETTING]โ the actual settings you wanna mess with; see the manpage, there's a whole list and we are not about to pretend otherwise ๐
su
su [-lmp] [-s SH] [-] [USER [FILE ARGS | -c 'CMD' [ARG0 ARGS]]]
Run a shell under USER โ and yeah, by default that's root ๐
-,-lโ clear the environment, jump to the home dir, and run the shell as a login shell-p,-mโ do not set new$HOME,$SHELL,$USER,$LOGNAME-c CMDโ command to hand off tosh -c-s SHโ the shell to use instead of the user's default one
sulogin
sulogin [-t N] [TTY]
Single user login ๐ (yes, the dramatic rescue mode one)
-pโ start a login shell-t SECโ timeout
svc
svc [-udopchaitkx] SERVICE_DIR...
Control the services being watched by the runsv supervisor ๐ธ
-uโ if the service isn't running, start it; if it stops, restart it-dโ if the service is running, send itTERM+CONTsignals, and do not restart it-oโ once: if the service isn't running, start it and do not restart it-pchaitkโ sendSTOP,CONT,HUP,ALRM,INT,TERM, orKILLsignal to the service-xโ exit:runsvwill exit as soon as the service is down
svok
svok SERVICE_DIR
Check whether the runsv supervisor is running ๐ Exit code is 0 if it is, 100 if it isn't, and 111 (with an error message, so you will know) if SERVICE_DIR doesn't exist.
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 (whenPOLis omitted)-eโ silently skip devices that don't exist (no drama, no error ๐ซถ)
switch_root
switch_root [-c CONSOLE_DEV] NEW_ROOT NEW_INIT [ARGS]
Free the initramfs and switch to another root fs ๐ Here's the whole ritual:
chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint. No exceptions, this is not a vibe-flexible situation.
-c DEVโ reopen stdio to DEV after the switch
sync
sync [-df] [FILE]...
Write all buffered blocks (in FILEs) to disk ๐พ
-dโ avoid syncing metadata-fโ sync filesystems underlying FILEs
sysctl
sysctl [-enq] { -a | -p [FILE]... | [-w] [KEY[=VALUE]]... }
Show/set kernel parameters ๐
-eโ don't warn about unknown keys-nโ don't show key names-qโ quiet-aโ show all values-pโ set values from FILEs (default/etc/sysctl.conf)-wโ set values
syslogd
syslogd [OPTIONS]
The system logging utility ๐
-nโ run in foreground-R HOST[:PORT]โ log toHOST:PORT(defaultPORT:514)-Lโ log locally and via network (default is network only if-Ris given)-C[size_kb]โ log to a shared mem buffer (uselogreadto read it)-O FILEโ log to FILE (default:/var/log/messages, or stdout if it's-)-s SIZEโ max size (KB) before rotation (default200KB,0=off)-b NโNrotated logs to keep (default1, max99,0=purge)-l Nโ log only messages more urgent than prioN(1-8)-Sโ smaller output-tโ strip client-generated timestamps-Dโ drop duplicates-f FILEโ use FILE as config (default:/etc/syslog.conf)
tac
tac [FILE]...
Concatenate FILEs and print them in reverse ๐ (it's cat backwards, in every sense)
tail
tail [OPTIONS] [FILE]...
Print the last 10 lines of FILEs (or stdin) to. With more than one FILE, put a filename header before each one ๐
-c [+]N[bkm]โ print lastNbytes-n N[bkm]โ print lastNlines-n +N[bkm]โ start on theNth line and print the rest (whereb:512,k:1024,m:1024^2)-qโ never print headers-vโ always print headers-fโ print data as the file grows ๐-Fโ same as-f, but keeps retrying-s SECONDSโ wait SECONDS between reads with-f
tar
tar c|x|t [-ZzJjahmvokO] [-f TARFILE] [-C DIR] [FILE]...
Create, extract, or list files from a tar file ๐
cโ createxโ extracttโ list-f FILEโ name of TARFILE (-for stdin/out)-C DIRโ change to DIR before the operation-vโ verbose-Oโ extract to stdout-mโ don't restoremtime-oโ don't restoreuser:group-kโ don't replace existing files-Zโ (de)compress usingcompress-zโ (de)compress usinggzip-Jโ (de)compress usingxz-jโ (de)compress usingbzip2--lzmaโ (de)compress usinglzma-aโ (de)compress based on extension-hโ follow symlinks--overwriteโ replace existing files--strip-components NUMโ NUM of leading components to strip--no-recursionโ don't descend in directories--numeric-ownerโ use numericuser:group--no-same-permissionsโ don't restore access permissions--to-command COMMANDโ pipe files to COMMAND
taskset
taskset [-ap] [HEXMASK | -c LIST] { PID | PROG ARGS }
Set or get CPU affinity ๐ง
-pโ operate on PID-aโ operate on all threads-cโ affinity is a list, not a mask
tc
tc OBJECT CMD [dev STRING]
Where OBJECT: qdisc|class|filter and CMD: add|del|change|replace|show ๐
qdisc [handle QHANDLE] [root|ingress|parent CLASSID]
[[QDISC_KIND] [help|OPTIONS]]
QDISC_KIND := [p|b]fifo|tbf|prio|red|etc.
qdisc show [dev STRING] [ingress]
class [classid CLASSID] [root|parent CLASSID]
[[QDISC_KIND] [help|OPTIONS] ]
class show [ dev STRING ] [root|parent CLASSID]
filter [pref PRIO] [protocol PROTO]
[root|classid CLASSID] [handle FILTERID]
[[FILTER_TYPE] [help|OPTIONS]]
filter show [dev STRING] [root|parent CLASSID]
Traffic control, bestie โ this is the whole networking main-character arc ๐
tee
tee [-ai] [FILE]...
Copy stdin to each FILE, and also to stdout ๐ซถ (splitting the stream like a true icon)
-aโ append to the given FILEs, don't overwrite-iโ ignore interrupt signals (SIGINT)
telnet
telnet [-a] [-l USER] HOST [PORT]
Connect to a telnet server ๐ป
-aโ automatic login with the$USERenvvar-l USERโ automatic login as USER
tftp
tftp [OPTIONS] HOST [PORT]
Transfer a file from/to a tftp server โจ
-l FILEโ local FILE-r FILEโ remote FILE-gโ get file-pโ put file-b SIZEโ transfer blocks in bytes
time
time [-vpa] [-o FILE] PROG ARGS
Run PROG and display resource usage when it exits โฑ๏ธ
-vโ verbose-pโ POSIX output format-f FMTโ custom format-o FILEโ write result to FILE-aโ append (else overwrite)
timeout
timeout [-s SIG] [-k KILL_SECS] SECS PROG ARGS
Run PROG. Send SIG to it if it's not gone in SECS seconds. Default SIG: TERM. If it still exists in KILL_SECS seconds, send KILL. ๐ (polite first, then not polite at all)
top
top [-bH] [-n COUNT] [-d SECONDS]
Show a view of process activity in real time ๐ Read the status of all processes from /proc each SECONDS and show a screenful of them.
Keys:
N/M/P/T: sort by pid/mem/cpu/timeR: reverse sortH: toggle threadsQ,^C: exit
Options:
-bโ batch mode-n Nโ exit afterNiterations-d SECโ delay between updates-Hโ show threads
touch
touch [-cham] [-d DATE] [-t DATE] [-r FILE] FILE...
Update mtime of FILEs ๐
-cโ don't create files-hโ don't follow links-aโ change onlyatime-mโ change onlymtime-d DTโ date/time to use-t DTโ date/time to use-r FILEโ use FILE's date/time
tr
tr [-cds] STRING1 [STRING2]
Translate, squeeze, or delete characters from stdin, writing to stdout ๐
-cโ take the complement of STRING1-dโ delete input characters coded STRING1-sโ squeeze multiple output characters of STRING2 into one character
traceroute
traceroute [-46Flnrv] [-f 1ST_TTL] [-m MAXTTL] [-q PROBES] [-p PORT]
[-t TOS] [-w WAIT_SEC] [-s SRC_IP] [-i IFACE]
[-z PAUSE_MSEC] HOST [BYTES]
Trace the route to HOST ๐
-4,-6โ force IP or IPv6 name resolution-Fโ set the don't fragment bit-lโ displayTTLvalue of the returned packet-nโ print numeric addresses-rโ bypass routing tables, send directly to HOST-vโ verbose-f Nโ first number of hops (default1)-m Nโ max number of hops-q Nโ number of probes per hop (default3)-p Nโ base UDP port number used in probes (default33434)-s IPโ source address-i IFACEโ source interface-t Nโ type-of-service in probe packets (default0)-w SECโ wait for a response (default3)-z MSECโ wait before each send
traceroute6
traceroute6 [-nrv] [-f 1ST_TTL] [-m MAXTTL] [-q PROBES] [-p PORT]
[-t TOS] [-w WAIT_SEC] [-s SRC_IP] [-i IFACE]
[-z PAUSE_MSEC] HOST [BYTES]
Trace the route to HOST ๐โจ
-nโ print numeric addresses-rโ bypass routing tables, send directly to HOST-vโ verbose-f Nโ first number of hops (default1)-m Nโ max number of hops-q Nโ number of probes per hop (default3)-p Nโ base UDP port number used in probes (default33434)-s IPโ source address-i IFACEโ source interface-t Nโ type-of-service in probe packets (default0)-w SECโ wait for a response (default3)-z MSECโ wait before each send
truncate
truncate [-c] -s SIZE FILE...
Truncate FILEs to SIZE โ๏ธ
-cโ do not create files-s SIZEโ (the size, bestie, that's the whole point)
ts
ts [-is] [STRFTIME]
Pipe stdin to stdout, add a timestamp to each line โฐ
-sโ time since start-iโ time since previous line
tty
tty [-s]
Print the file name of stdin's terminal ๐ซถ
-sโ print nothing, only return the exit status
tunctl
tunctl [-f DEVICE] [-t NAME | -d NAME]
Create or delete TUN/TAP interfaces ๐ฆ
-f DEVโ TUN device (default/dev/net/tun)-t NAMEโ create iface (default:tapN)-d NAMEโ delete iface
ubirename
ubirename UBI_DEVICE OLD_VOLNAME NEW_VOLNAME [OLD2 NEW2]...
Rename UBI volumes on UBI_DEVICE ๐
udhcpc
udhcpc [-fbqRB] [-a[MSEC]] [-t N] [-T SEC] [-A SEC|-n] [-i IFACE]
[-s PROG] [-p PIDFILE] [-oC] [-r IP] [-V VENDOR] [-F NAME] [-x
OPT:VAL]... [-O OPT]...
okay bestie, this is the DHCP client โ the little guy that walks up to your router and is like "hi, may i please have an IP ๐ฅบ" and the router is like "sure babe" ๐ . Here's literally every knob:
-i IFACEโ which interface to use (default iseth0)-s PROGโ runPROGat DHCP events (default is/etc/udhcpc/default.script)-p FILEโ create a pidfile-Bโ request broadcast replies-t Nโ send up toNdiscover packets (default3)-T SECโ pause between packets (default3)-A SECโ wait this long if a lease isn't obtained (default20)-bโ go to the background if a lease isn't obtained-nโ exit if a lease isn't obtained-qโ exit once you've obtained a lease-Rโ release the IP on exit-fโ run in the foreground-Sโ log to syslog too-a[MSEC]โ validate the offered address with an ARP ping-r IPโ request this IP address specifically-oโ don't request any options (unless-Ois given)-O OPTโ request optionOPTfrom the server (cumulative, so stack 'em up)-x OPT:VALโ include optionOPTin sent packets (cumulative too)- examples of string, numeric, and hex byte opts:
-x hostname:bboxโ option 12-x lease:3600โ option 51 (lease time)-x 0x3d:0100BEEFC0FFEEโ option 61 (client id)-x 14:'"dumpfile"'โ option 14 (shell-quoted)
-F NAMEโ ask the server to update the DNS mapping forNAME-V VENDORโ vendor identifier (default is'udhcp VERSION')-Cโ don't send the MAC as the client identifier
Signals:
USR1โ renew leaseUSR2โ release lease
udhcpc6
udhcpc6 [-fbqR] [-t N] [-T SEC] [-A SEC|-n] [-i IFACE] [-s PROG]
[-p PIDFILE] [-mldo] [-r IPv6] [-x OPT:VAL]... [-O OPT]...
same energy, but v6 flavored ๐ฆ:
-i IFACEโ interface to use (defaulteth0)-p FILEโ create pidfile-s PROGโ runPROGat DHCP events (default/etc/udhcpc/default6.script)-t Nโ send up toNdiscover packets-T SECโ pause between packets (default3)-A SECโ wait if lease is not obtained (default20)-bโ background if lease is not obtained-nโ exit if lease is not obtained-qโ exit after obtaining lease-Rโ release IP on exit-fโ run in foreground-Sโ log to syslog too-mโ send multicast renew requests rather than unicast ones-lโ send an 'information request' instead of 'solicit' (this is the one for servers that do not assign IPv6 addresses, iykyk)-r IPv6โ request this address ('no'to not request any IP)-dโ request prefix-oโ don't request any options (unless-Ois given)-O OPTโ request optionOPTfrom server (cumulative)-x OPT:VALโ include optionOPTin sent packets (cumulative)- examples of string, numeric, and hex byte opts:
-x hostname:bboxโ option 12-x lease:3600โ option 51 (lease time)-x 0x3d:0100BEEFC0FFEEโ option 61 (client id)-x 14:'"dumpfile"'โ option 14 (shell-quoted)
Signals:
USR1โ renew leaseUSR2โ release lease
udhcpd
udhcpd [-fS] [-I ADDR] [-a MSEC] [CONFFILE]
DHCP server โ yes bb, the other side of the conversation. Now you are the one handing out IPs and everyone wants your attention ๐
-fโ run in foreground-Sโ log to syslog too-I ADDRโ local address-a MSECโ timeout for ARP ping (default2000)
Signals:
USR1โ update lease file
uevent
uevent [PROG ARGS]
okay so uevent runs PROG for every netlink notification. PROG's environment contains data passed from the kernel. The classic glow-up usage (a daemon for dynamic device node creation):
# uevent mdev & mdev -s
umount
umount [-rlfda] [-t FSTYPE] FILESYSTEM|DIRECTORY
Unmount filesystems โ telling your disk "bye bestie, we're done here" ๐
-aโ unmount all filesystems-rโ remount devices read-only if mount is busy-lโ lazy umount (detach filesystem)-fโ force umount (i.e., unreachable NFS server)-dโ free loop device if it has been used-t FSTYPE[,...]โ unmount only these filesystem type(s)
uname
uname [-amnrspvio]
Print system information โ the OG "who even are you" ๐ซถ
-aโ print all-mโ machine (hardware) type-nโ hostname-rโ kernel release-sโ kernel name (default)-pโ processor type-vโ kernel version-iโ hardware platform-oโ OS name
uncompress
uncompress [-cf] [FILE]...
Decompress FILEs (or stdin) โ squish reversal โจ
-cโ write to stdout-fโ overwrite
unexpand
unexpand [-fa][-t N] [FILE]...
Convert spaces to tabs, writing to stdout โ doing the exact opposite of what expand does, and living its truth ๐คก
-aโ convert all blanks-fโ convert only leading blanks-t Nโ tabstops everyNchars
uniq
uniq [-cduiz] [-f,s,w N] [FILE [OUTFILE]]
Discard duplicate lines โ the "you're all saying the same thing, one of you speak" of Unix ๐
-cโ prefix lines by the number of occurrences-dโ only print duplicate lines-uโ only print unique lines-iโ ignore case-zโ NUL terminated output-f Nโ skip firstNfields-s Nโ skip firstNchars (after any skipped fields)-w Nโ compareNcharacters in line
unix2dos
unix2dos [-ud] [FILE]
Convert FILE in-place from Unix to DOS format. When no file is given, use stdin/stdout. (line endings are a โจvibeโจ)
-uโdos2unix-dโunix2dos
unlink
unlink FILE
Delete FILE by calling unlink() โ no thoughts, no recycling bin, just gone ๐
unlzma
unlzma [-cfk] [FILE]...
Decompress FILEs (or stdin) โ the LZMA un-squeeze ๐ฆ
-cโ write to stdout-fโ force-kโ keep input files-tโ test integrity
unshare
unshare [OPTIONS] [PROG ARGS]
main character energy: this is literally not like other processes โ it gets its very own namespaces ๐
-m,--mount[=FILE]โ unshare mount namespace-u,--uts[=FILE]โ unshare UTS namespace (hostname etc.)-i,--ipc[=FILE]โ unshare System V IPC namespace-n,--net[=FILE]โ unshare network namespace-p,--pid[=FILE]โ unshare PID namespace-U,--user[=FILE]โ unshare user namespace-fโ fork before execingPROG-rโ map current user to root (implies-U)--mount-proc[=DIR]โ mount/procfilesystem first (implies-m)--propagation slave|shared|private|unchangedโ modify mount propagation in the mount namespace--setgroups allow|denyโ control thesetgroupssyscall in user namespaces
unxz
unxz [-cfk] [FILE]...
Decompress FILEs (or stdin) โ xz but backwards, iconic โญ
-cโ write to stdout-fโ force-kโ keep input files-tโ test integrity
unzip
unzip [-lnojpqK] FILE[.zip] [FILE]... [-x FILE]... [-d DIR]
Extract FILEs from ZIP archive โ the birthday-present unwrap ๐โจ
-lโ list contents (with-qfor short form)-nโ never overwrite files (default: ask)-oโ overwrite-jโ do not restore paths-pโ write to stdout-tโ test-qโ quiet-Kโ do not clear SUID bit-x FILEโ excludeFILEs-d DIRโ extract intoDIR
uptime
uptime
Display the time since the last boot โ how long has this machine been awake and thriving ๐ธ
usleep
usleep N
Pause for N microseconds โ tiny little nap, micro edition ๐ด
uudecode
uudecode [-o OUTFILE] [INFILE]
Uudecode a file. Finds OUTFILE in uuencoded source unless -o is given.
uuencode
uuencode [-m] [FILE] STORED_FILENAME
Uuencode FILE (or stdin) to stdout โ converting binary into something a mail server won't have a meltdown over ๐ซถ
-mโ use base64 encoding per RFC1521
uuidgen
uuidgen
Generate a random UUID โ a fresh identity, no baggage, every single time ๐ โจ
vconfig
vconfig COMMAND [OPTIONS]
Create and remove virtual ethernet devices โ network stacking, but make it fashion ๐
add IFACE VLAN_IDrem VLAN_NAMEset_flag IFACE 0|1 VLAN_QOSset_egress_map VLAN_NAME SKB_PRIO VLAN_QOSset_ingress_map VLAN_NAME SKB_PRIO VLAN_QOSset_name_type NAME_TYPE
vi
vi [-c CMD] [-R] [-H] [FILE]...
Edit FILE โ the editor your grandpa fought wars in and honestly still slays ๐
-c CMDโ initial command to run ($EXINITand~/.exrcalso available)-Rโ read-only-Hโ list available features
vmstat
vmstat [-n] [INTERVAL [COUNT]]
Show virtual memory statistics โ numbers go brrr and honestly they're kind of hot ๐๐ฅ
-nโ show header once
w
w
Show who is logged on โ the group chat roster of your machine ๐ฌ
watch
watch [-n SEC] [-tx] PROG ARGS
Run PROG periodically โ refreshing like your feed, forever, because you can't look away ๐
-n SECโ period (default2)-tโ don't print header-xโexec(PROG,ARGS)instead ofsh -c 'PROG ARGS'
watchdog
watchdog [-t N[ms]] [-T N[ms]] [-F] DEV
Periodically write to watchdog device DEV โ the "if i stop responding, reboot me" safety net, no cap ๐ถ
-T Nโ reboot afterNseconds if not reset (default60)-t Nโ reset everyNseconds (default30)-Fโ run in foreground
Use 500ms to specify period in milliseconds โ heads up on the units bestie, they bite ๐ญ
wc
wc [-cmlwL] [FILE]...
Count lines, words, and bytes for FILEs (or stdin) โ the original counting bestie ๐ข
-cโ count bytes-mโ count characters-lโ count newlines-wโ count words-Lโ print longest line length
wget
wget [-cqS] [--spider] [-O FILE] [-o LOGFILE] [--header STR]
[--post-data STR | --post-file FILE] [-Y on/off]
[--no-check-certificate] [-P DIR] [-U AGENT] [-T SEC] URL...
Retrieve files via HTTP or FTP โ the internet fetch quest, gorgeous ๐
--spiderโ only check URL existence:$?is 0 if exists--header STRโ addSTR(of form'header: value') to headers--post-data STRโ sendSTRusing POST method--post-file FILEโ sendFILEusing POST method--no-check-certificateโ don't validate the server's certificate-cโ continue retrieval of aborted transfer-qโ quiet-P DIRโ save toDIR(default.)-Sโ show server response-T SECโ network read timeout isSECseconds-O FILEโ save toFILE('-'for stdout)-o LOGFILEโ log messages toFILE-U STRโ useSTRfor User-Agent header-Y on/offโ use proxy
which
which [-a] COMMAND...
Locate COMMAND โ the "where is she" of the shell ๐ต๏ธโโ๏ธ
-aโ show all matches
who
who [-aH]
Show who is logged on โ same vibe as w, different fit ๐ฏ
-aโ show all-Hโ print column headers
whoami
whoami
the identity crisis command ๐ชโจ โ that's the whole thing, that's the whole synopsis, and honestly? iconic.
and for whoami โ it just prints the user name tied to your current effective user id ๐
periodt.
xargs ๐
xargs [OPTIONS] [PROG ARGS]
runs PROG on every item coming from stdin, like a little assembly line for your commands ๐ญโจ
-0โ NUL terminated input-a FILEโ read fromFILEinstead of stdin-oโ reopen stdin as/dev/tty-rโ don't run command if input is empty-tโ print the command on stderr before execution-pโ ask user whether to run each command-E STR,-e[STR]โSTRstops input processing-I STRโ replaceSTRwithinPROG ARGSwith input line-n Nโ pass no more thanNargs toPROG-s Nโ pass command line of no more thanNbytes-P Nโ run up toNPROGs in parallel-xโ exit if size is exceeded
xxd ๐
xxd [-ri] [-ps] [-g N] [-c N] [-l LEN] [-s OFS] [-o OFS] [FILE]
hex dumps FILE (or stdin) so you can see all the bytes in their hexadecimal glory โจ
-g Nโ bytes per group (default 2)-c Nโ bytes per line (default:16,-ps:30,-i:12)-psโ show only hex bytes (no offset/spaces)-iโ C include file style-l LENGTHโ show only firstLENGTHbytes-s OFFSETโ skipOFFSETbytes-o OFFSETโ addOFFSETto displayed offset-rโ reverse (with-p, assumes no offsets in input)
xz ๐ฆ
xz -d [-cfk] [FILE]...
decompresses FILEs (or stdin) because compression is so last season ๐
-dโ decompress-cโ write to stdout-fโ force-kโ keep input files-tโ test integrity
xzcat ๐ธ
xzcat [FILE]...
decompresses to stdout, like xz -dc but cuter ๐
yes ๐
yes [STRING]
repeatedly prints a line with STRING, or just y if you don't give it one. infinite vibes โจ
zcat ๐
zcat [FILE]...
decompresses to stdout, classic move ๐
๐ง LIBC NSS ๐ง
GNU Libc (glibc) uses the Name Service Switch (NSS) to configure how the C library behaves for your local environment, and to configure how it reads system data โ like passwords and group information. This is implemented using an /etc/nsswitch.conf configuration file, and using one or more of the /lib/libnss_* libraries. BusyBox tries to avoid using any libc calls that make use of NSS. But some applets โ like login and su โ will use libc functions that require NSS. ๐
If you enable CONFIG_USE_BB_PWD_GRP, BusyBox will use internal functions to directly access the /etc/passwd, /etc/group, and /etc/shadow files without using NSS. This may allow you to run your system without needing to install any of the NSS configuration files and libraries. ๐
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, you could use a C library such as uClibc. In addition to making your system significantly smaller, uClibc does not require the use of any NSS support files or libraries. ๐
๐ MAINTAINER ๐
- Denis Vlasenko
<vda.linux@googlemail.com>โ the maintainer, holding it down ๐
โจ AUTHORS โจ
okay so the following people have contributed code to BusyBox whether they know it or not. If you wrote code that's in BusyBox, you should probably be listed here so you can get your bit of eternal glory. If you should be listed here, or the description of what you did needs more detail, or is straight-up wrong, please send in an update. ๐
- Emanuele Aina
<emanuele.aina@tiscali.it>โ didrun-parts๐ - Erik Andersen
<andersen@codepoet.org>โ brought tons of new stuff, did a major rewrite of most of the core apps, added tons of new apps (as noted in the header files), and put in lots of tedious effort writing these boring docs that nobody is actually going to read. ๐ญ - Laurence Anderson
<l.d.anderson@warwick.ac.uk>โ gave usrpm2cpio,unzip,get_header_cpio, theread_gzinterface, andrpm๐ - Jeff Angielski
<jeff@theptrgroup.com>โ didftpputandftpget๐ - Edward Betts
<edward@debian.org>โ gave usexpr,hostid,logname, andwhoami๐ - John Beppu
<beppu@codepoet.org>โ diddu,nslookup, andsort๐ - Brian Candler
<B.Candler@pobox.com>โ madetiny-ls(ls)๐ฃ - Randolph Chung
<tausq@debian.org>โ didfbset,ping, andhostname๐ - Dave Cinege
<dcinege@psychosis.com>โ broughtmore(v2),makedevs,dutmp, modularization, the auto links file, various fixes, and Linux Router Project maintenance ๐ ๏ธ - Jordan Crouse
<jordan@cosmicpenguin.net>โ didipcalc๐งฎ - Magnus Damm
<damm@opensource.se>โ addedtftpclientinsmodpowerpc support ๐ช - Larry Doolittle
<ldoolitt@recycle.lbl.gov>โ did pristine source directory compilation, lots of patches and fixes. ๐ฉน - Glenn Engel
<glenne@engel.org>โ didhttpd๐ - Gennady Feldman
<gfeldman@gena01.com>โ brought Sysklogd (single threadedsyslogd, IPC Circular buffer support,logread), and various fixes. ๐ - Karl M. Hegbloom
<karlheg@debian.org>โ didcp_mv.c, the test suite, various fixes toutility.c, &c. ๐งช - Daniel Jacobowitz
<dan@debian.org>โ didmktemp.c๐ - Matt Kraai
<kraai@alumni.cmu.edu>โ did documentation, bugfixes, and the test suite ๐ - Stephan Linz
<linz@li-pro.net>โ didipcalcand Red Hat equivalence ๐ฉ - John Lombardo
<john@deltanet.com>โ didtr๐ - Glenn McGrath
<bug1@iinet.net.au>โ did common unarchiving code and unarchiving applets,ifupdown,ftpgetput,nameif,sed,patch,fold,install,uudecode. Also various bugfixes, review and apply numerous patches. ๐ฆ - Manuel Novoa III
<mjn3@codepoet.org>โ didcat,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 of triviallibbbroutines. Also bug fixes, partial rewrites, and size optimizations inash,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>โ didcmdedit;xargs(current),httpd(current); ports:ash,crond,fdisk,inetd,stty,traceroute,top; locale, various fixes, and was an 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>โ did bug fixes, member of fan club ๐ - Kent Robotti
<robotti@metconnect.com>โ didreset, tons and tons of bug reports and patches. ๐ - Chip Rosenthal
<chip@unicom.com>,<crosenth@covad.com>โ didwget- contributed by permission of Covad Communications. ๐ก - Pavel Roskin
<proski@gnu.org>โ did lots of bugs fixes and patches. ๐ง - Gyepi Sam
<gyepi@praxis-sw.com>โ added remote logging feature forsyslogd๐ก - Linus Torvalds
<torvalds@transmeta.com>โ didmkswap,fsck.minix,mkfs.minix๐ง - Mark Whitley
<markw@codepoet.org>โ didgrep,sed,cut,xargs(previous), the style-guide, new-applet-HOWTO, bug fixes, etc. ๐ - Charles P. Wright
<cpwright@villagenet.com>โ didgzip,mini-netcat(nc)๐๏ธ - Enrique Zanardi
<ezanardi@ull.es>โ didtarcat(since removed),loadkmap, various fixes, Debian maintenance. ๐ง - Tito Ragusa
<farmatito@tiscali.it>โ diddevfsdand size optimizations instrings,openvt, anddeallocvt. ๐ - Paul Fox
<pgf@foxharp.boston.ma.us>โ did vi editing mode forash, various other patches/fixes. โ๏ธ - Roberto A. Foglietta
<me@roberto.foglietta.name>โ porteddnsd๐ - Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com>โ did misc stuff ๐ฒ - Mike Frysinger
<vapier@gentoo.org>โ did initial e2fsprogs,printenv,setarch,sum, misc. ๐ ๏ธ - Jie Zhang
<jie.zhang@analog.com>โ fixed two bugs inmshandhush(exitcode of killed processes) ๐
and that's the whole page, bestie! this was BusyBox version 1.38.0, dated 2026-09-24, and it's the BUSYBOX(1) man page. now go slay some unix! ๐โจ
๐ฆ where this page comes from
- ubuntu stonking: busybox 1:1.38.0-3ubuntu4 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms