toybox -sh -toysh : acpi addgroup adduser arp arping base64 basename blkid blockdev brctl bunzip2 bzcat cal cat catv cd chattr chgrp chmod chown chroot chvt cksum clear cmp comm compress count cp cpio crond cut date dd deallocvt delgroup deluser df dhcp dhcp6 dhcpd diff dirname dmesg dos2unix du dumpleases echo egrep eject env exit expand expr factor fallocate false fdisk fgrep file find flock fold free freeramdisk fsck fsfreeze fstype fsync ftpget ftpput getty grep groupadd groupdel groups gunzip gzip halt head hello help hexedit host hostid hostname hwclock iconv id ifconfig init inotifyd insmod install ionice iorenice iotop ip ipaddr ipcrm ipcs iplink iproute iprule iptunnel kill killall killall5 klogd last link ln logger login logname losetup ls lsattr lsmod lsof lspci lsusb makedevs md5sum mdev mix mkdir mke2fs mkfifo mknod mkpasswd mkswap mktemp modinfo modprobe more mount mountpoint mv nc netcat netstat nice nl nohup nproc nsenter od oneit partprobe passwd paste patch pgrep pidof ping pivot_root pkill pmap poweroff printenv printf ps pwd pwdx readahead readlink realpath reboot renice reset rev rfkill rm rmdir rmmod route sed seq setsid sh sha1sum shred skeleton skeleton_alias sleep sort split stat strings su sulogin swapoff swapon switch_root sync sysctl syslogd tac tail tar taskset tee telnet telnetd test test_human_readable test_many_options test_scankey tftp tftpd time timeout top touch toysh tr traceroute traceroute6 true truncate tty ulimit umount uname uniq unix2dos unlink unshare uptime useradd userdel usleep uudecode uuencode vconfig vi vmstat w watch wc wget which who whoami xargs xxd xzcat yes zcat


toybox

usage: toybox [--long | --version | [command] [arguments...]]

With no arguments, shows available commands. First argument is
name of a command to run, followed by any arguments to that command.

--long	Show path to each command
--version	Show toybox version

To install command symlinks, try:
  for i in $(/bin/toybox --long); do ln -s /bin/toybox $i; done


-sh

usage: sh [-c command] [script]

Command shell.  Runs a shell script, or reads input interactively
and responds to it.

-c	command line to execute
-i	interactive mode (default when STDIN is a tty)


-toysh

usage: sh [-c command] [script]

Command shell.  Runs a shell script, or reads input interactively
and responds to it.

-c	command line to execute
-i	interactive mode (default when STDIN is a tty)


:

Return zero.


acpi

usage: acpi [-abctV]

Show status of power sources and thermal devices.

-a	show power adapters
-b	show batteries
-c	show cooling device state
-t	show temperatures
-V	show everything


addgroup

usage: groupadd [-S] [-g GID] [USER] GROUP

Add a group or add a user to a group

  -g GID Group id
  -S     Create a system group


adduser

usage: useradd [-SDH] [-h DIR] [-s SHELL] [-G GRP] [-g NAME] [-u UID] USER [GROUP]

Create new user, or add USER to GROUP

-D       Don't assign a password
-g NAME  Real name
-G GRP   Add user to existing group
-h DIR   Home directory
-H       Don't create home directory
-s SHELL Login shell
-S       Create a system user
-u UID   User id


arp

Usage: 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 ARP cache

-a    Display (all) hosts
-s    Set new ARP entry
-d    Delete a specified entry
-v    Verbose
-n    Don't resolve names
-i IF Network interface
-D    Read  from given device
-A,-p AF  Protocol family
-H    HWTYPE Hardware address type



arping

usage: 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         Duplicated address detection mode
-U         Unsolicited ARP mode, update your neighbors
-A         ARP answer mode, update your neighbors
-c N       Stop after sending N ARP requests
-w TIMEOUT Time to wait for ARP reply, seconds
-I IFACE   Interface to use (default eth0)
-s SRC_IP  Sender IP address
DST_IP     Target IP address


base64

usage: base64 [-di] [-w COLUMNS] [FILE...]

Encode or decode in base64.

-d	decode
-i	ignore non-alphabetic characters
-w	wrap output at COLUMNS (default 76 or 0 for no wrap)


basename

usage: basename string [suffix]

Return non-directory portion of a pathname removing suffix


blkid

usage: blkid DEV...

Prints type, label and UUID of filesystem on a block device or image.


blockdev

usage: blockdev --OPTION... BLOCKDEV...

Call ioctl(s) on each listed block device

OPTIONs:
--setro		Set read only
--setrw		Set read write
--getro		Get read only
--getss		Get sector size
--getbsz	Get block size
--setbsz	BYTES	Set block size
--getsz		Get device size in 512-byte sectors
--getsize	Get device size in sectors (deprecated)
--getsize64	Get device size in bytes
--flushbufs	Flush buffers
--rereadpt	Reread partition table


brctl

usage: brctl COMMAND [BRIDGE [INTERFACE]]

Manage ethernet bridges

Commands:
show                  Show a list of bridges
addbr BRIDGE          Create BRIDGE
delbr BRIDGE          Delete BRIDGE
addif BRIDGE IFACE    Add IFACE to BRIDGE
delif BRIDGE IFACE    Delete IFACE from BRIDGE
setageing BRIDGE TIME Set ageing time
setfd BRIDGE TIME     Set bridge forward delay
sethello BRIDGE TIME  Set hello time
setmaxage BRIDGE TIME Set max message age
setpathcost BRIDGE PORT COST   Set path cost
setportprio BRIDGE PORT PRIO   Set port priority
setbridgeprio BRIDGE PRIO      Set bridge priority
stp BRIDGE [1/yes/on|0/no/off] STP on/off


bunzip2

usage: bunzip2 [-cftkv] [FILE...]

Decompress listed files (file.bz becomes file) deleting archive file(s).
Read from stdin if no files listed.

-c	force output to stdout
-f	force decompression. (If FILE doesn't end in .bz, replace original.)
-k	keep input files (-c and -t imply this)
-t  test integrity
-v	verbose


bzcat

usage: bzcat [FILE...]

Decompress listed files to stdout. Use stdin if no files listed.


cal

usage: cal [[month] year]

Print a calendar.

With one argument, prints all months of the specified year.
With two arguments, prints calendar for month and year.


cat

usage: cat [-etuv] [file...]

Copy (concatenate) files to stdout.  If no files listed, copy from stdin.
Filename "-" is a synonym for stdin.

-e	Mark each newline with $
-t	Show tabs as ^I
-u	Copy one byte at a time (slow).
-v	Display nonprinting characters as escape sequences. Use M-x for
	high ascii characters (>127), and ^x for other nonprinting chars.

catv

usage: catv [-evt] [filename...]

Display nonprinting characters as escape sequences. Use M-x for
high ascii characters (>127), and ^x for other nonprinting chars.

-e  Mark each newline with $
-t  Show tabs as ^I
-v  Don't use ^x or M-x escapes.


cd

usage: cd [-PL] [path]

Change current directory.  With no arguments, go $HOME.

-P	Physical path: resolve symlinks in path.
-L	Local path: .. trims directories off $PWD (default).


chattr

usage: chattr [-R] [-+=AacDdijsStTu] [-v version] [File...]

Change file attributes on a Linux second extended file system.

Operators:
  '-' Remove attributes.
  '+' Add attributes.
  '=' Set attributes.

Attributes:
  A  Don't track atime.
  a  Append mode only.
  c  Enable compress.
  D  Write dir contents synchronously.
  d  Don't backup with dump.
  i  Cannot be modified (immutable).
  j  Write all data to journal first.
  s  Zero disk storage when deleted.
  S  Write file contents synchronously.
  t  Disable tail-merging of partial blocks with other files.
  u  Allow file to be undeleted.
  -R Recurse.
  -v Set the file's version/generation number.



chgrp

usage: chgrp/chown [-RHLP] [-fvh] group file...

Change group of one or more files.

-f	suppress most error messages.
-h	change symlinks instead of what they point to
-R	recurse into subdirectories (implies -h).
-H	with -R change target of symlink, follow command line symlinks
-L	with -R change target of symlink, follow all symlinks
-P	with -R change symlink, do not follow symlinks (default)
-v	verbose output.


chmod

usage: chmod [-R] MODE FILE...

Change mode of listed file[s] (recursively with -R).

MODE can be (comma-separated) stanzas: [ugoa][+-=][rwxstXugo]

Stanzas are applied in order: For each category (u = user,
g = group, o = other, a = all three, if none specified default is a),
set (+), clear (-), or copy (=), r = read, w = write, x = execute.
s = u+s = suid, g+s = sgid, o+s = sticky. (+t is an alias for o+s).
suid/sgid: execute as the user/group who owns the file.
sticky: can't delete files you don't own out of this directory
X = x for directories or if any category already has x set.

Or MODE can be an octal value up to 7777	ug uuugggooo	top +
bit 1 = o+x, bit 1<<8 = u+w, 1<<11 = g+1	sstrwxrwxrwx	bottom

Examples:
chmod u+w file - allow owner of "file" to write to it.
chmod 744 file - user can read/write/execute, everyone else read only


chown

usage: chgrp/chown [-RHLP] [-fvh] group file...

Change group of one or more files.

-f	suppress most error messages.
-h	change symlinks instead of what they point to
-R	recurse into subdirectories (implies -h).
-H	with -R change target of symlink, follow command line symlinks
-L	with -R change target of symlink, follow all symlinks
-P	with -R change symlink, do not follow symlinks (default)
-v	verbose output.


chroot

usage: chroot NEWPATH [commandline...]

Run command within a new root directory. If no command, run /bin/sh.


chvt

usage: chvt N

Change to virtual terminal number N. (This only works in text mode.)

Virtual terminals are the Linux VGA text mode displays, ordinarily
switched between via alt-F1, alt-F2, etc. Use ctrl-alt-F1 to switch
from X to a virtual terminal, and alt-F6 (or F7, or F8) to get back.


cksum

usage: cksum [-IPLN] [file...]

For each file, output crc32 checksum value, length and name of file.
If no files listed, copy from stdin.  Filename "-" is a synonym for stdin.

-H	Hexadecimal checksum (defaults to decimal)
-L	Little endian (defaults to big endian)
-P	Pre-inversion
-I	Skip post-inversion
-N	Do not include length in CRC calculation


clear

Clear the screen.


cmp

usage: cmp [-l] [-s] FILE1 FILE2

Compare the contents of two files.

-l	show all differing bytes
-s	silent


comm

usage: comm [-123] FILE1 FILE2

Reads FILE1 and FILE2, which should be ordered, and produces three text
columns as output: lines only in FILE1; lines only in FILE2; and lines
in both files. Filename "-" is a synonym for stdin.

-1 suppress the output column of lines unique to FILE1
-2 suppress the output column of lines unique to FILE2
-3 suppress the output column of lines duplicated in FILE1 and FILE2


compress

usage: compress [-199LRcdgglrzz] [FILE] [FILE]

Compress or decompress file (or stdin) using "deflate" algorithm.

Compress or decompress file (or stdin) using "deflate" algorithm.

-1	min compression
-9	max compression (default)
-L	zlib
-R	raw
-c	compress with -g gzip (default)  -l zlib  -r raw  -z zip
-d	decompress (autodetects type)
-g	gzip (default)
-z	zip



count

usage: count

Copy stdin to stdout, displaying simple progress indicator to stderr.


cp

usage: cp [--preserve=motcxa] [-adlnrsvfipRHLP] SOURCE... DEST

Copy files from SOURCE to DEST.  If more than one SOURCE, DEST must
be a directory.
-v	verbose
-s	symlink instead of copy
-r	synonym for -R
-n	no clobber (don't overwrite DEST)
-l	hard link instead of copy
-d	don't dereference symlinks
-a	same as -dpr
-P	Do not follow symlinks [default]
-L	Follow all symlinks
-H	Follow symlinks listed on command line
-R	recurse into subdirectories (DEST must be a directory)
-p	preserve timestamps, ownership, and mode
-i	interactive, prompt before overwriting existing DEST
-F	delete any existing destination file first (--remove-destination)
-f	delete destination files we can't write to
--preserve takes either a comma separated list of attributes, or the first
letter(s) of:

        mode - permissions (ignore umask for rwx, copy suid and sticky bit)
   ownership - user and group
  timestamps - file creation, modification, and access times.
     context - security context
       xattr - extended attributes
         all - all of the above


cpio

usage: cpio -{o|t|i|p DEST} [-v] [--verbose] [-F FILE] [--no-preserve-owner]
       [ignored: -mdu -H newc]

copy files into and out of a "newc" format cpio archive

-F FILE	use archive FILE instead of stdin/stdout
-p DEST	copy-pass mode, copy stdin file list to directory DEST
-i	extract from archive into file system (stdin=archive)
-o	create archive (stdin=list of files, stdout=archive)
-t	test files (list only, stdin=archive, stdout=list of files)
-v	verbose (list files during create/extract)
--no-preserve-owner (don't set ownership during extract)


crond

usage: crond [-fbS] [-l N] [-d N] [-L LOGFILE] [-c DIR]

A daemon to execute scheduled commands.

-b Background (default)
-c crontab dir
-d Set log level, log to stderr
-f Foreground
-l Set log level. 0 is the most verbose, default 8
-S Log to syslog (default)
-L Log to file


cut

usage: cut OPTION... [FILE]...

Print selected parts of lines from each FILE to standard output.

-b LIST	select only these bytes from LIST.
-c LIST	select only these characters from LIST.
-f LIST	select only these fields.
-d DELIM	use DELIM instead of TAB for field delimiter.
-s	do not print lines not containing delimiters.
-n	don't split multibyte characters (Ignored).


date

usage: date [-u] [-r FILE] [-d DATE] [+DISPLAY_FORMAT] [-D SET_FORMAT] [SET]

Set/get the current date/time. With no SET shows the current date.

Default SET format is "MMDDhhmm[[CC]YY][.ss]", that's (2 digits each)
month, day, hour (0-23), and minute. Optionally century, year, and second.
Also accepts "@UNIXTIME[.FRACTION]" as seconds since midnight Jan 1 1970.

-d	Show DATE instead of current time (convert date format)
-D	+FORMAT for SET or -d (instead of MMDDhhmm[[CC]YY][.ss])
-r	Use modification time of FILE instead of current date
-u	Use UTC instead of current timezone

+FORMAT specifies display format string using these escapes:

%% literal %             %n newline              %t tab
%S seconds (00-60)       %M minute (00-59)       %m month (01-12)
%H hour (0-23)           %I hour (01-12)         %p AM/PM
%y short year (00-99)    %Y year                 %C century
%a short weekday name    %A weekday name         %u day of week (1-7, 1=mon)
%b short month name      %B month name           %Z timezone name
%j day of year (001-366) %d day of month (01-31) %e day of month ( 1-31)
%s seconds past the Epoch

%U Week of year (0-53 start sunday)   %W Week of year (0-53 start monday)
%V Week of year (1-53 start monday, week < 4 days not part of this year)

%D = "%m/%d/%y"    %r = "%I : %M : %S %p"   %T = "%H:%M:%S"   %h = "%b"
%x locale date     %X locale time           %c locale date/time


dd

usage: dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [bs=N] [count=N] [skip=N]
        [seek=N] [conv=notrunc|noerror|sync|fsync]

Options:
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

Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024),
MD (x1000000), M (x1048576), GD (x1000000000) or G (x1073741824)
Copy a file, converting and formatting according to the operands.


deallocvt

usage: deallocvt [N]

Deallocate unused virtual terminal /dev/ttyN, or all unused consoles.


delgroup

usage: groupdel [USER] GROUP

Delete a group or remove a user from a group


deluser

usage: userdel [-r] USER
usage: deluser [-r] USER

Options:
-r remove home directory
Delete USER from the SYSTEM


df

usage: df [-HPkh] [-t type] [FILESYSTEM ...]

The "disk free" command shows total/used/available disk space for
each filesystem listed on the command line, or all currently mounted
filesystems.

-P	The SUSv3 "Pedantic" option
-k	Sets units back to 1024 bytes (the default without -P)
-h	Human readable output (K=1024)
-H	Human readable output (k=1000)
-t type	Display only filesystems of this type.

Pedantic provides a slightly less useful output format dictated by Posix,
and sets the units to 512 bytes instead of the default 1024 bytes.


dhcp

usage: dhcp [-fbnqvoCRB] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]
            [-H HOSTNAME] [-V VENDOR] [-x OPT:VAL] [-O OPT]

     Configure network dynamicaly using DHCP.

   -i Interface to use (default eth0)
   -p Create pidfile
   -s Run PROG at DHCP events (default /usr/share/dhcp/default.script)
   -B Request broadcast replies
   -t Send up to N discover packets
   -T Pause between packets (default 3 seconds)
   -A Wait N seconds after failure (default 20)
   -f Run in foreground
   -b Background if lease is not obtained
   -n Exit if lease is not obtained
   -q Exit after obtaining lease
   -R Release IP on exit
   -S Log to syslog too
   -a Use arping to validate offered address
   -O Request option OPT from server (cumulative)
   -o Don't request any options (unless -O is given)
   -r Request this IP address
   -x OPT:VAL  Include option OPT in sent packets (cumulative)
   -F Ask server to update DNS mapping for NAME
   -H Send NAME as client hostname (default none)
   -V VENDOR Vendor identifier (default 'toybox VERSION')
   -C Don't send MAC as client identifier
   -v Verbose

   Signals:
   USR1  Renew current lease
   USR2  Release current lease



dhcp6

usage: dhcp6 [-fbnqvR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE]

      Configure network dynamicaly using DHCP.

    -i Interface to use (default eth0)
    -p Create pidfile
    -s Run PROG at DHCP events
    -t Send up to N Solicit packets
    -T Pause between packets (default 3 seconds)
    -A Wait N seconds after failure (default 20)
    -f Run in foreground
    -b Background if lease is not obtained
    -n Exit if lease is not obtained
    -q Exit after obtaining lease
    -R Release IP on exit
    -S Log to syslog too
    -r Request this IP address
    -v Verbose

    Signals:
    USR1  Renew current lease
    USR2  Release current lease


dhcpd

usage: dhcpd [-46fS] [-i IFACE] [-P N] [CONFFILE]

 -f    Run in foreground
 -i Interface to use
 -S    Log to syslog too
 -P N  Use port N (default ipv4 67, ipv6 547)
 -4, -6    Run as a DHCPv4 or DHCPv6 server


diff

usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2

-a  Treat all files as text
-b  Ignore changes in the amount of whitespace
-B  Ignore changes whose lines are all blank
-d  Try hard to find a smaller set of changes
-i  Ignore case differences
-L  Use LABEL instead of the filename in the unified header
-N  Treat absent files as empty
-q  Output only whether files differ
-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


dirname

usage: dirname PATH

Show directory portion of path.


dmesg

usage: dmesg [-c] [-r|-t] [-n LEVEL] [-s SIZE]

Print or control the kernel ring buffer.

-c	Clear the ring buffer after printing
-n	Set kernel logging LEVEL (1-9)
-r	Raw output (with )
-s	Show the last SIZE many bytes
-t	Don't print kernel's timestamps


dos2unix

usage: dos2unix [FILE...]

Convert newline format from dos "\r\n" to unix "\n".
If no files listed copy from stdin, "-" is a synonym for stdin.


du

usage: du [-d N] [-askxHLlmc] [file...]

Show disk usage, space consumed by files and directories.

Size in:
-k    1024 byte blocks (default)
-K    512 byte blocks (posix)
-m    megabytes
-h    human readable format (e.g., 1K 243M 2G )

What to show:
-a    all files, not just directories
-H    follow symlinks on cmdline
-L    follow all symlinks
-s    only total size of each argument
-x    don't leave this filesystem
-c    cumulative total
-d N  only depth < N
-l    disable hardlink filter


dumpleases

usage: dumpleases [-r|-a] [-f LEASEFILE]

Display DHCP leases granted by udhcpd
-f FILE,  Lease file
-r        Show remaining time
-a        Show expiration time


echo

usage: echo [-ne] [args...]

Write each argument to stdout, with one space between each, followed
by a newline.

-n	No trailing newline.
-e	Process the following escape sequences:
	\\	backslash
	\0NNN	octal values (1 to 3 digits)
	\a	alert (beep/flash)
	\b	backspace
	\c	stop output here (avoids trailing newline)
	\f	form feed
	\n	newline
	\r	carriage return
	\t	horizontal tab
	\v	vertical tab
	\xHH	hexadecimal values (1 to 2 digits)


egrep

usage: grep [-EFivwcloqsHbhn] [-A NUM] [-m MAX] [-e REGEX]... [-f REGFILE] [FILE]...

Show lines matching regular expressions. If no -e, first argument is
regular expression to match. With no files (or "-" filename) read stdin.
Returns 0 if matched, 1 if no match found.

-e  Regex to match. (May be repeated.)
-f  File containing regular expressions to match.

match type:
-A  Show NUM lines after     -B  Show NUM lines before match
-C  NUM lines context (A+B)  -E  extended regex syntax
-F  fixed (literal match)    -i  case insensitive
-m  match MAX many lines     -r  recursive (on dir)
-v  invert match             -w  whole word (implies -E)
-x  whole line               -z  input NUL terminated

display modes: (default: matched line)
-c  count of matching lines  -l  show matching filenames
-o  only matching part       -q  quiet (errors only)
-s  silent (no error msg)    -Z  output NUL terminated

output prefix (default: filename if checking more than 1 file)
-H  force filename           -b  byte offset of match
-h  hide filename            -n  line number of match


eject

usage: eject [-stT] [DEVICE]

Eject DEVICE or default /dev/cdrom

-s	SCSI device
-t	Close tray
-T	Open/close tray (toggle).


env

usage: env [-i] [-u NAME] [NAME=VALUE...] [command [option...]]

Set the environment for command invocation.

-i	Clear existing environment.
-u NAME	Remove NAME from the environment


exit

usage: exit [status]

Exit shell.  If no return value supplied on command line, use value
of most recent command, or 0 if none.


expand

usage: expand [-t TABLIST] [FILE...]

Expand tabs to spaces according to tabstops.

-t	TABLIST

Specify tab stops, either a single number instead of the default 8,
or a comma separated list of increasing numbers representing tabstop
positions (absolute, not increments) with each additional tab beyound
that becoming one space.


expr

usage: expr ARG1 OPERATOR ARG2...

Evaluate expression and print result. For example, "expr 1 + 2".

The supported operators are (grouped from highest to lowest priority):

  ( )    :    * / %    + -    != <= < >= > =    &    |

Each constant and operator must be a separate command line argument.
All operators are infix, meaning they expect a constant (or expression
that resolves to a constant) on each side of the operator. Operators of
the same priority (within each group above) are evaluated left to right.
Parentheses may be used (as separate arguments) to elevate the priority
of expressions.

Calling expr from a command shell requires a lot of \( or '*' escaping
to avoid interpreting shell control characters.

The & and | operators are logical (not bitwise) and may operate on
strings (a blank string is "false"). Comparison operators may also
operate on strings (alphabetical sort).

Constants may be strings or integers. Comparison, logical, and regex
operators may operate on strings (a blank string is "false"), other
operators require integers.


factor

usage: factor NUMBER...

Factor integers.


fallocate

usage: fallocate [-l size] file

Tell the filesystem to allocate space for a file.


false

Return nonzero.


fdisk

usage: fdisk [-lu] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SECTSZ] DISK

Change partition table

-u            Start and End are in sectors (instead of cylinders)
-l            Show partition table for each DISK, then exit
-b size       sector size (512, 1024, 2048 or 4096)
-C CYLINDERS  Set number of cylinders/heads/sectors
-H HEADS
-S SECTORS


fgrep

usage: grep [-EFivwcloqsHbhn] [-A NUM] [-m MAX] [-e REGEX]... [-f REGFILE] [FILE]...

Show lines matching regular expressions. If no -e, first argument is
regular expression to match. With no files (or "-" filename) read stdin.
Returns 0 if matched, 1 if no match found.

-e  Regex to match. (May be repeated.)
-f  File containing regular expressions to match.

match type:
-A  Show NUM lines after     -B  Show NUM lines before match
-C  NUM lines context (A+B)  -E  extended regex syntax
-F  fixed (literal match)    -i  case insensitive
-m  match MAX many lines     -r  recursive (on dir)
-v  invert match             -w  whole word (implies -E)
-x  whole line               -z  input NUL terminated

display modes: (default: matched line)
-c  count of matching lines  -l  show matching filenames
-o  only matching part       -q  quiet (errors only)
-s  silent (no error msg)    -Z  output NUL terminated

output prefix (default: filename if checking more than 1 file)
-H  force filename           -b  byte offset of match
-h  hide filename            -n  line number of match


file

usage: file [file...]

Examine the given files and describe their content types.


find

usage: find [-HL] [DIR...] []

Search directories for matching files.
Default: search "." match all -print all matches.

-H  Follow command line symlinks         -L  Follow all symlinks

Match filters:
-name  PATTERN  filename with wildcards   -iname      case insensitive -name
-path  PATTERN  path name with wildcards  -ipath      case insensitive -path
-user  UNAME    belongs to user UNAME     -nouser     user ID not known
-group GROUP    belongs to group GROUP    -nogroup    group ID not known
-perm  [-/]MODE permissions (-=min /=any) -prune      ignore contents of dir
-size  N[c]     512 byte blocks (c=bytes) -xdev       only this filesystem
-links N        hardlink count            -atime N    accessed N days ago
-ctime N        created N days ago        -mtime N    modified N days ago
-newer FILE     newer mtime than FILE     -mindepth # at least # dirs down
-depth          ignore contents of dir    -maxdepth # at most # dirs down
-inum  N        inode number N            -empty      empty files and dirs
-type [bcdflps] (block, char, dir, file, symlink, pipe, socket)

Numbers N may be prefixed by a - (less than) or + (greater than):

Combine matches with:
!, -a, -o, ( )    not, and, or, group expressions

Actions:
-print   Print match with newline  -print0    Print match with null
-exec    Run command with path     -execdir   Run command in file's dir
-ok      Ask before exec           -okdir     Ask before execdir
-delete  Remove matching file/dir

Commands substitute "{}" with matched file. End with ";" to run each file,
or "+" (next argument after "{}") to collect and run with multiple files.


flock

usage: flock [-sxun] fd

Manage advisory file locks.

-s	Shared lock.
-x	Exclusive lock (default).
-u	Unlock.
-n	Non-blocking: fail rather than wait for the lock.


fold

usage: fold [-bsu] [-w WIDTH] [FILE...]

Folds (wraps) or unfolds ascii text by adding or removing newlines.
Default line width is 80 columns for folding and infinite for unfolding.

-b	Fold based on bytes instead of columns
-s	Fold/unfold at whitespace boundaries if possible
-u	Unfold text (and refold if -w is given)
-w	Set lines to WIDTH columns or bytes


free

usage: free [-bkmgt]

Display the total, free and used amount of physical memory and swap space.

-bkmgt	Output units (default is bytes)
-h	Human readable


freeramdisk

usage: freeramdisk [RAM device]

Free all memory allocated to specified ramdisk


fsck

usage: fsck [-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]...

Check and repair filesystems

-A      Walk /etc/fstab and check all filesystems
-N      Don't execute, just show what would be done
-P      With -A, check filesystems in parallel
-R      With -A, skip the root filesystem
-T      Don't show title on startup
-V      Verbose
-C n    Write status information to specified filedescriptor
-t TYPE List of filesystem types to check



fsfreeze

usage: fsfreeze {-f | -u} MOUNTPOINT

Freeze or unfreeze a filesystem.

-f	freeze
-u	unfreeze


fstype

usage: fstype DEV...

Prints type of filesystem on a block device or image.


fsync

usage: fsync [-d] [FILE...]

Synchronize a file's in-core state with storage device.

-d	Avoid syncing metadata.


ftpget

usage: ftpget [-cv] [-u USER -p PASSWORD -P PORT] HOST_NAME [LOCAL_FILENAME] REMOTE_FILENAME
usage: ftpput [-v] [-u USER -p PASSWORD -P PORT] HOST_NAME [REMOTE_FILENAME] LOCAL_FILENAME

ftpget - Get a remote file from FTP.
ftpput - Upload a local file on remote machine through FTP.

-c Continue previous transfer.
-v Verbose.
-u User name.
-p Password.
-P Port Number (default 21).


ftpput

usage: ftpget [-cv] [-u USER -p PASSWORD -P PORT] HOST_NAME [LOCAL_FILENAME] REMOTE_FILENAME
usage: ftpput [-v] [-u USER -p PASSWORD -P PORT] HOST_NAME [REMOTE_FILENAME] LOCAL_FILENAME

ftpget - Get a remote file from FTP.
ftpput - Upload a local file on remote machine through FTP.

-c Continue previous transfer.
-v Verbose.
-u User name.
-p Password.
-P Port Number (default 21).


getty

usage: getty [OPTIONS] BAUD_RATE[,BAUD_RATE]... TTY [TERMTYPE]

-h    Enable hardware RTS/CTS flow control
-L    Set CLOCAL (ignore Carrier Detect state)
-m    Get baud rate from modem's CONNECT status message
-n    Don't prompt for login name
-w    Wait for CR or LF before sending /etc/issue
-i    Don't display /etc/issue
-f ISSUE_FILE  Display ISSUE_FILE instead of /etc/issue
-l LOGIN  Invoke LOGIN instead of /bin/login
-t SEC    Terminate after SEC if no login name is read
-I INITSTR  Send INITSTR before anything else
-H HOST    Log HOST into the utmp file as the hostname


grep

usage: grep [-EFivwcloqsHbhn] [-A NUM] [-m MAX] [-e REGEX]... [-f REGFILE] [FILE]...

Show lines matching regular expressions. If no -e, first argument is
regular expression to match. With no files (or "-" filename) read stdin.
Returns 0 if matched, 1 if no match found.

-e  Regex to match. (May be repeated.)
-f  File containing regular expressions to match.

match type:
-A  Show NUM lines after     -B  Show NUM lines before match
-C  NUM lines context (A+B)  -E  extended regex syntax
-F  fixed (literal match)    -i  case insensitive
-m  match MAX many lines     -r  recursive (on dir)
-v  invert match             -w  whole word (implies -E)
-x  whole line               -z  input NUL terminated

display modes: (default: matched line)
-c  count of matching lines  -l  show matching filenames
-o  only matching part       -q  quiet (errors only)
-s  silent (no error msg)    -Z  output NUL terminated

output prefix (default: filename if checking more than 1 file)
-H  force filename           -b  byte offset of match
-h  hide filename            -n  line number of match


groupadd

usage: groupadd [-S] [-g GID] [USER] GROUP

Add a group or add a user to a group

  -g GID Group id
  -S     Create a system group


groupdel

usage: groupdel [USER] GROUP

Delete a group or remove a user from a group


groups

usage: groups [user]

Print the groups a user is in.


gunzip

usage: gunzip [-cflqStv] [FILE...]

Decompess (deflate) file(s). With no files, compress stdin to stdout.

On successful decompression, compressed files are replaced with the
uncompressed version. The input file is removed and replaced with
a new file without the .gz extension (with same ownership/permissions).

-c	cat to stdout (act as zcat)
-f	force (output file exists, input is tty, unrecognized extension)
-l	list compressed/uncompressed/ratio/name for each input file.
-q	quiet (no warnings)
-S	specify exension (default .*)
-t	test compressed file(s)
-v	verbose (like -l, but decompress files)


gzip

usage: gzip [-19LRScdfgqtvz] [FILE...]

Compess (deflate) file(s). With no files, compress stdin to stdout.

On successful decompression, compressed files are replaced with the
uncompressed version. The input file is removed and replaced with
a new file without the .gz extension (with same ownership/permissions).
-1	Minimal compression (fastest)
-9	Max compression (default)
-S	specify exension (default .*)
-c	cat to stdout (act as zcat)
-d	decompress (act as gunzip)
-f	force (if output file exists, input is tty, unrecognized extension)
-q	quiet (no warnings)
-t	test compressed file(s)
-v	verbose (like -l, but compress files)

Compression type:
-g gzip (default)    -L zlib    -R raw    -z zip

halt

usage: reboot/halt/poweroff [-fn]

Restart, halt or powerdown the system.

-f	Don't signal init
-n	Don't sync before stopping the system.


head

usage: head [-n number] [file...]

Copy first lines from files to stdout. If no files listed, copy from
stdin. Filename "-" is a synonym for stdin.

-n	Number of lines to copy.


hello

usage: hello [-s]

A hello world program.  You don't need this.

Mostly used as a simple template for adding new commands.
Occasionally nice to smoketest kernel booting via "init=/usr/bin/hello".


help

usage: help [-ah] [command]

Show usage information for toybox commands.
Run "toybox" with no arguments for a list of available commands.

-h	HTML output
-a	All commands

hexedit

usage: hexedit FILENAME

Hexadecimal file editor. All changes are written to disk immediately.

-r	Read only (display but don't edit)

Keys:
Arrows        Move left/right/up/down by one line/column
Pg Up/Pg Dn   Move up/down by one page
0-9, a-f      Change current half-byte to hexadecimal value
u             Undo
q/^c/^d/ Quit


host

usage: host [-av] [-t TYPE] NAME [SERVER]

Perform DNS lookup on NAME, which can be a domain name to lookup,
or an ipv4 dotted or ipv6 colon seprated address to reverse lookup.
SERVER (if present) is the DNS server to use.

-a	no idea
-t	not a clue
-v	verbose


hostid

usage: hostid

Print the numeric identifier for the current host.


hostname

usage: hostname [newname]

Get/Set the current hostname


hwclock

usage: hwclock [-rswtluf]

-f FILE Use specified device file instead of /dev/rtc (--rtc)
-l      Hardware clock uses localtime (--localtime)
-r      Show hardware clock time (--show)
-s      Set system time from hardware clock (--hctosys)
-t      Set the system time based on the current timezone (--systz)
-u      Hardware clock uses UTC (--utc)
-w      Set hardware clock from system time (--systohc)


iconv

usage: iconv [-f FROM] [-t TO] [FILE...]

Convert character encoding of files.

-f  convert from (default utf8)
-t  convert to   (default utf8)


id

usage: id [-nGgru]

Print user and group ID.

-n	print names instead of numeric IDs (to be used with -Ggu)
-G	Show only the group IDs
-g	Show only the effective group ID
-r	Show real ID instead of effective ID
-u	Show only the effective user ID


ifconfig

usage: ifconfig [-a] [INTERFACE [ACTION...]]

Display or configure network interface.

With no arguments, display active interfaces. First argument is interface
to operate on, one argument by itself displays that interface.

-a	Show all interfaces, not just active ones

Additional arguments are actions to perform on the interface:

ADDRESS[/NETMASK] - set IPv4 address (1.2.3.4/5)
default - unset ipv4 address
add|del ADDRESS[/PREFIXLEN] - add/remove IPv6 address (1111::8888/128)
up - enable interface
down - disable interface

netmask|broadcast|pointopoint ADDRESS - set more IPv4 characteristics
hw ether|infiniband ADDRESS - set LAN hardware address (AA:BB:CC...)
txqueuelen LEN - number of buffered packets before output blocks
mtu LEN - size of outgoing packets (Maximum Transmission Unit)

Flags you can set on an interface (or -remove by prefixing with -):
arp - don't use Address Resolution Protocol to map LAN routes
promisc - don't discard packets that aren't to this LAN hardware address
multicast - force interface into multicast mode if the driver doesn't
allmulti - promisc for multicast packets

Obsolete fields included for historical purposes:
irq|io_addr|mem_start ADDR - micromanage obsolete hardware
outfill|keepalive INTEGER - SLIP analog dialup line quality monitoring
metric INTEGER - added to Linux 0.9.10 with comment "never used", still true


init

usage: init

System V style init.

First program to run (as PID 1) when the system comes up, reading
/etc/inittab to determine actions.


inotifyd

usage: inotifyd PROG FILE[:MASK] ...

When a filesystem event matching MASK occurs to a FILE, run PROG as:

  PROG EVENTS FILE [DIRFILE]

If PROG is "-" events are sent to stdout.

This file is:
  a  accessed    c  modified    e  metadata change  w  closed (writable)
  r  opened      D  deleted     M  moved            0  closed (unwritable)
  u  unmounted   o  overflow    x  unwatchable

A file in this directory is:
  m  moved in    y  moved out   n  created          d  deleted

When x event happens for all FILEs, inotifyd exits (after waiting for PROG).


insmod

usage: insmod MODULE [MODULE_OPTIONS]

Load the module named MODULE passing options if given.


install

usage: install [-dDpsv] [-o USER] [-g GROUP] [-m MODE] [SOURCE...] DEST

Copy files and set attributes.

-d	Act like mkdir -p
-D	Create leading directories for DEST
-g	Make copy belong to GROUP
-m	Set permissions to MODE
-o	Make copy belong to USER
-p	Preserve timestamps
-s	Call "strip -p"
-v	Verbose


ionice

usage: ionice [-t] [-c CLASS] [-n LEVEL] [COMMAND...|-p PID]

Change the I/O scheduling priority of a process. With no arguments
(or just -p), display process' existing I/O class/priority.

-c	CLASS = 1-3: 1(realtime), 2(best-effort, default), 3(when-idle)
-n	LEVEL = 0-7: (0 is highest priority, default = 5)
-p	Affect existing PID instead of spawning new child
-t	Ignore failure to set I/O priority

System default iopriority is generally -c 2 -n 4.


iorenice

usage: iorenice PID [CLASS] [PRIORITY]

Display or change I/O priority of existing process. CLASS can be
"rt" for realtime, "be" for best effort, "idle" for only when idle, or
"none" to leave it alone. PRIORITY can be 0-7 (0 is highest, default 4).


iotop

usage: iotop [-AaKO]

Rank processes by I/O.

-A	All I/O, not just disk
-a	Accumulated I/O (not percentage)
-K	Kilobytes
-k	Fallback sort FIELDS (default -[D]IO,-ETIME,-PID)
-O	Only show processes doing I/O
-o	Show FIELDS (default PID,PR,USER,[D]READ,[D]WRITE,SWAP,[D]IO,COMM)
-s	Sort by field number (0-X, default 6)


ip

usage: ip [ OPTIONS ] OBJECT { COMMAND }

Show / manipulate routing, devices, policy routing and tunnels.

where OBJECT := {address | link | route | rule | tunnel}
OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }


ipaddr

usage: ip [ OPTIONS ] OBJECT { COMMAND }

Show / manipulate routing, devices, policy routing and tunnels.

where OBJECT := {address | link | route | rule | tunnel}
OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }


ipcrm

usage: ipcrm [ [-q msqid] [-m shmid] [-s semid]
          [-Q msgkey] [-M shmkey] [-S semkey] ... ]

-mM Remove memory segment after last detach
-qQ Remove message queue
-sS Remove semaphore


ipcs

usage: ipcs [[-smq] -i shmid] | [[-asmq] [-tcplu]]

-i Show specific resource
Resource specification:
-a All (default)
-m Shared memory segments
-q Message queues
-s Semaphore arrays
Output format:
-c Creator
-l Limits
-p Pid
-t Time
-u Summary


iplink

usage: ip [ OPTIONS ] OBJECT { COMMAND }

Show / manipulate routing, devices, policy routing and tunnels.

where OBJECT := {address | link | route | rule | tunnel}
OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }


iproute

usage: ip [ OPTIONS ] OBJECT { COMMAND }

Show / manipulate routing, devices, policy routing and tunnels.

where OBJECT := {address | link | route | rule | tunnel}
OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }


iprule

usage: ip [ OPTIONS ] OBJECT { COMMAND }

Show / manipulate routing, devices, policy routing and tunnels.

where OBJECT := {address | link | route | rule | tunnel}
OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }


iptunnel

usage: ip [ OPTIONS ] OBJECT { COMMAND }

Show / manipulate routing, devices, policy routing and tunnels.

where OBJECT := {address | link | route | rule | tunnel}
OPTIONS := { -f[amily] { inet | inet6 | link } | -o[neline] }


kill

usage: kill [-l [SIGNAL] | -s SIGNAL | -SIGNAL] pid...

Send signal to process(es).

-l	List signal name(s) and number(s)
-s	Send SIGNAL (default SIGTERM)


killall

usage: killall [-l] [-iqv] [-SIGNAL|-s SIGNAL] PROCESS_NAME...

Send a signal (default: TERM) to all processes with the given names.

-i	ask for confirmation before killing
-l	print list of all available signals
-q	don't print any warnings or error messages
-s	send SIGNAL instead of SIGTERM
-v	report if the signal was successfully sent


killall5

usage: killall5 [-l [SIGNAL]] [-SIGNAL|-s SIGNAL] [-o PID]...

Send a signal to all processes outside current session.

-l     List signal name(s) and number(s)
-o PID Omit PID
-s     send SIGNAL (default SIGTERM)


klogd

usage: klogd [-n] [-c N]

-c  N   Print to console messages more urgent than prio N (1-8)"
-n    Run in foreground.


last

usage: last [-W] [-f FILE]

Show listing of last logged in users.

-W      Display the information without host-column truncation.
-f FILE Read from file FILE instead of /var/log/wtmp.


link

usage: link FILE NEWLINK

Create hardlink to a file.


ln

usage: ln [-sfnv] [FROM...] TO

Create a link between FROM and TO.
With only one argument, create link in current directory.

-s	Create a symbolic link
-f	Force the creation of the link, even if TO already exists
-n	Symlink at destination treated as file
-v	Verbose


logger

usage: logger [-s] [-t tag] [-p [facility.]priority] [message]

Log message (or stdin) to syslog.


login

usage: login [-p] [-h host] [-f USERNAME] [USERNAME]

Log in as a user, prompting for username and password if necessary.

-p	Preserve environment
-h	The name of the remote host for this login
-f	login as USERNAME without authentication


logname

usage: logname

Print the current user name.


losetup

usage: losetup [-cdrs] [-o OFFSET] [-S SIZE] {-d DEVICE...|-j FILE|-af|{DEVICE FILE}}

Associate a loopback device with a file, or show current file (if any)
associated with a loop device.

Instead of a device:
-a	Iterate through all loopback devices
-f	Find first unused loop device (may create one)
-j	Iterate through all loopback devices associated with FILE

existing:
-c	Check capacity (file size changed)
-d	Detach loopback device

new:
-s	Show device name (alias --show)
-o	Start assocation at OFFSET into FILE
-r	Read only
-S	Limit SIZE of loopback association (alias --sizelimit)


ls

usage: ls --color[=auto] [-ACFHLRSZacdfhiklmnpqrstux1] [directory...]

list files

what to show:
-a  all files including .hidden    -b  escape nongraphic chars
-c  use ctime for timestamps       -d  directory, not contents
-i  inode number                   -k  block sizes in kilobytes
-p  put a '/' after dir names      -q  unprintable chars as '?'
-s  size (in blocks)               -u  use access time for timestamps
-A  list all files but . and ..    -H  follow command line symlinks
-L  follow symlinks                -R  recursively list files in subdirs
-F  append /dir *exe @sym |FIFO    -Z  security context

output formats:
-1  list one file per line         -C  columns (sorted vertically)
-g  like -l but no owner           -h  human readable sizes
-l  long (show full details)       -m  comma separated
-n  like -l but numeric uid/gid    -o  like -l but no group
-x  columns (horizontal sort)

sorting (default is alphabetical):
-f  unsorted    -r  reverse    -t  timestamp    -S  size
--color  device=yellow  symlink=turquoise/red  dir=blue  socket=purple
         files: exe=green  suid=red  suidfile=redback  stickydir=greenback
         =auto means detect if output is a tty.


lsattr

usage: lsattr [-Radlv] [Files...]

List file attributes on a Linux second extended file system.

-R Recursively list attributes of directories and their contents.
-a List all files in directories, including files that start with '.'.
-d List directories like other files, rather than listing their contents.
-l List long flag names.
-v List the file's version/generation number.


lsmod

usage: lsmod

Display the currently loaded modules, their sizes and their dependencies.


lsof

usage: lsof [-lt] [-p PID1,PID2,...] [NAME]...

Lists open files. If names are given on the command line, only
those files will be shown.

-l	list uids numerically
-p	for given comma-separated pids only (default all pids)
-t	terse (pid only) output


lspci

usage: lspci [-ekmn] [-i FILE ] 

List PCI devices.
-e	Print all 6 digits in class
-i	PCI ID database (default /usr/share/misc/pci.ids)
-k	Print kernel driver
-m	Machine parseable format
-n	Numeric output (repeat for readable and numeric)

lsusb

usage: lsusb

List USB hosts/devices.


makedevs

usage: makedevs [-d device_table] rootdir

Create a range of special files as specified in a device table.

-d	file containing device table (default reads from stdin)

Each line of of the device table has the fields:
         
Where name is the file name, and type is one of the following:

b	Block device
c	Character device
d	Directory
f	Regular file
p	Named pipe (fifo)

Other fields specify permissions, user and group id owning the file,
and additional fields for device special files. Use '-' for blank entries,
unspecified fields are treated as '-'.


md5sum

usage: md5sum [FILE]...

Calculate md5 hash for each input file, reading from stdin if none.
Output one hash (16 hex digits) for each input file, followed by
filename.

-b	brief (hash only, no filename)


mdev

usage: mdev [-s]

Create devices in /dev using information from /sys.

-s	Scan all entries in /sys to populate /dev.


mix

usage: mix [-d DEV] [-c CHANNEL] [-l VOL] [-r RIGHT]

List OSS sound channels (module snd-mixer-oss), or set volume(s).

-c CHANNEL	Set/show volume of CHANNEL (default first channel found)
-d DEV		Device node (default /dev/mixer)
-l VOL		Volume level
-r RIGHT	Volume of right stereo channel (with -r, -l sets left volume)


mkdir

usage: mkdir [-vp] [-m mode] [dirname...]

Create one or more directories.

-m	set permissions of directory to mode.
-p	make parent directories as needed.
-v	verbose


mke2fs

usage: mke2fs [-E stride=###] [-O option[,option]] [-L label] [-M path] [-o string] [-j] [-J size=###,device=XXX] [-Fnq] [-b ###] [-N|i ###] [-m ###] device

Create an ext2 filesystem on a block device or filesystem image.

-E stride= Set RAID stripe size (in blocks)
-F         Force to run on a mounted device
-J         Journal options
-L         Volume label
-M         Path to mount point
-N inodes  Allocate this many inodes
-O [opts]  Specify fewer ext2 option flags (for old kernels)
-b size    Block size (1024, 2048, or 4096)
-i bytes   Allocate one inode for every XXX bytes of device
-j         Create journal (ext3)
-m percent Reserve this percent of filesystem space for root user
-n         Don't write to device
-o         Created by
-q         Quiet (no output)
           size: Number of blocks (1024-102400)
           device: Specify an external journal
           All of these are on by default (as appropriate)
   none         Clear default options (all but journaling)
   dir_index    Use htree indexes for large directories
   filetype     Store file type info in directory entry
   has_journal  Set by -j
   journal_dev  Set by -J device=XXX
   sparse_super Don't allocate huge numbers of redundant superblocks

mkfifo

usage: mkfifo [NAME...]

Create FIFOs (named pipes).


mknod

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

Create a special file NAME with a given type. TYPE is b for block device,
c or u for character device, p for named pipe (which ignores MAJOR/MINOR).

-m	Mode (file permissions) of new device, in octal or u+x format


mkpasswd

usage: mkpasswd [-P FD] [-m TYPE] [-S SALT] [PASSWORD] [SALT]

Crypt PASSWORD using crypt(3)

-P FD   Read password from file descriptor FD
-m TYPE Encryption method (des, md5, sha256, or sha512; default is des)
-S SALT


mkswap

usage: mkswap [-L LABEL] DEVICE

Sets up a Linux swap area on a device or file.


mktemp

usage: mktemp [-dqu] [-p DIR] [TEMPLATE]

Safely create a new file "DIR/TEMPLATE" and print its name.

-d	Create directory instead of file (--directory)
-p	Put new file in DIR (--tmpdir)
-q	Quiet, no error messages
-u	Don't create anything, just print what would be created

Each X in TEMPLATE is replaced with a random printable character. The
default TEMPLATE is tmp.XXXXXX, and the default DIR is $TMPDIR if set,
else "/tmp".


modinfo

usage: modinfo [-0] [-b basedir] [-k kernrelease] [-F field] [modulename...]

Display module fields for all specified modules, looking in
/lib/modules// (kernrelease defaults to uname -r).


modprobe

usage: modprobe [-alrqvsDb] MODULE [symbol=value][...]

modprobe utility - inserts modules and dependencies.

-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


more

usage: more [FILE...]

View FILE(s) (or stdin) one screenful at a time.


mount

usage: mount [-afFrsvw] [-t TYPE] [-o OPTION,] [[DEVICE] DIR]

Mount new filesystem(s) on directories. With no arguments, display existing
mounts.

-a	mount all entries in /etc/fstab (with -t, only entries of that TYPE)
-O	only mount -a entries that have this option
-f	fake it (don't actually mount)
-r	read only (same as -o ro)
-w	read/write (default, same as -o rw)
-t	specify filesystem type
-v	verbose

OPTIONS is a comma separated list of options, which can also be supplied
as --longopts.

This mount autodetects loopback mounts (a file on a directory) and
bind mounts (file on file, directory on directory), so you don't need
to say --bind or --loop. You can also "mount -a /path" to mount everything
in /etc/fstab under /path, even if it's noauto.



mountpoint

usage: mountpoint [-q] [-d] directory
       mountpoint [-q] [-x] device

-q	Be quiet, return zero if directory is a mountpoint
-d	Print major/minor device number of the directory
-x	Print major/minor device number of the block device


mv

usage: mv [-fivn] SOURCE... DEST"

-f	force copy by deleting destination file
-i	interactive, prompt before overwriting existing DEST
-v	verbose
-n	no clobber (don't overwrite DEST)


nc

usage: netcat [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}

-f	use FILENAME (ala /dev/ttyS0) instead of network
-p	local port number
-q	SECONDS quit this many seconds after EOF on stdin.
-s	local ipv4 address
-w	SECONDS timeout for connection

Use "stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho" with
netcat -f to connect to a serial port.


netcat

usage: netcat [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}

-f	use FILENAME (ala /dev/ttyS0) instead of network
-p	local port number
-q	SECONDS quit this many seconds after EOF on stdin.
-s	local ipv4 address
-w	SECONDS timeout for connection

Use "stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho" with
netcat -f to connect to a serial port.


netstat

usage: netstat [-pWrxwutneal]

Display networking information.

-r  Display routing table.
-a  Display all sockets (Default: Connected).
-l  Display listening server sockets.
-t  Display TCP sockets.
-u  Display UDP sockets.
-w  Display Raw sockets.
-x  Display Unix sockets.
-e  Display other/more information.
-n  Don't resolve names.
-W  Wide Display.
-p  Display PID/Program name for sockets.


nice

usage: nice [-n PRIORITY] command [args...]

Run a command line at an increased or decreased scheduling priority.

Higher numbers make a program yield more CPU time, from -20 (highest
priority) to 19 (lowest).  By default processes inherit their parent's
niceness (usually 0).  By default this command adds 10 to the parent's
priority.  Only root can set a negative niceness level.


nl

usage: nl [-E] [-l #] [-b MODE] [-n STYLE] [-s SEPARATOR] [-w WIDTH] [FILE...]

Number lines of input.

-E	Use extended regex syntax (when doing -b pREGEX)
-b	which lines to number: a (all) t (non-empty, default) pREGEX (pattern)
-l	Only count last of this many consecutive blank lines
-n	number STYLE: ln (left justified) rn (right justified) rz (zero pad)
-s	Separator to use between number and line (instead of TAB)
-w	Width of line numbers (default 6)


nohup

usage: nohup COMMAND [ARGS...]

Run a command that survives the end of its terminal.

Redirect tty on stdin to /dev/null, tty on stdout to "nohup.out".


nproc

usage: nproc [--all]

Print number of processors.

--all	Show all processors, not just ones this task can run on.


nsenter

usage: nsenter [-t pid] [-F] [-i] [-m] [-n] [-p] [-u] [-U] COMMAND...

Run COMMAND in an existing (set of) namespace(s).

-t  PID to take namespaces from    (--target)
-F  don't fork, even if -p is used (--no-fork)

The namespaces to switch are:

-i	SysV IPC: message queues, semaphores, shared memory (--ipc)
-m	Mount/unmount tree (--mount)
-n	Network address, sockets, routing, iptables (--net)
-p	Process IDs and init, will fork unless -F is used (--pid)
-u	Host and domain names (--uts)
-U	UIDs, GIDs, capabilities (--user)

If -t isn't specified, each namespace argument must provide a path
to a namespace file, ala "-i=/proc/$PID/ns/ipc"


od

usage: od [-bcdosxv] [-j #] [-N #] [-A doxn] [-t acdfoux[#]]

-A	Address base (decimal, octal, hexdecimal, none)
-j	Skip this many bytes of input
-N	Stop dumping after this many bytes
-t	output type a(scii) c(har) d(ecimal) f(loat) o(ctal) u(nsigned) (he)x
	plus optional size in bytes
	aliases: -b=-t o1, -c=-t c, -d=-t u2, -o=-t o2, -s=-t d2, -x=-t x2
-v	Don't collapse repeated lines together


oneit

usage: oneit [-p] [-c /dev/tty0] command [...]

Simple init program that runs a single supplied command line with a
controlling tty (so CTRL-C can kill it).

-c	Which console device to use (/dev/console doesn't do CTRL-C, etc).
-p	Power off instead of rebooting when command exits.
-r	Restart child when it exits.
-3	Write 32 bit PID of each exiting reparented process to fd 3 of child.
	(Blocking writes, child must read to avoid eventual deadlock.)

Spawns a single child process (because PID 1 has signals blocked)
in its own session, reaps zombies until the child exits, then
reboots the system (or powers off with -p, or restarts the child with -r).

Responds to SIGUSR1 by halting the system, SIGUSR2 by powering off,
and SIGTERM or SIGINT reboot.


partprobe

usage: partprobe DEVICE...

Tell the kernel about partition table changes

Ask the kernel to re-read the partition table on the specified devices.


passwd

usage: passwd [-a ALGO] [-dlu] 

update user's authentication tokens. Default : current user

-a ALGO	Encryption method (des, md5, sha256, sha512) default: des
-d		Set password to ''
-l		Lock (disable) account
-u		Unlock (enable) account


paste

usage: paste [-s] [-d list] [file...]

Replace newlines in files.

-d list    list of delimiters to separate lines
-s         process files sequentially instead of in parallel

By default print corresponding lines separated by .


patch

usage: patch [-i file] [-p depth] [-Ru]

Apply a unified diff to one or more files.

-i	Input file (defaults=stdin)
-l	Loose match (ignore whitespace)
-p	Number of '/' to strip from start of file paths (default=all)
-R	Reverse patch.
-u	Ignored (only handles "unified" diffs)

This version of patch only handles unified diffs, and only modifies
a file when all all hunks to that file apply.  Patch prints failed
hunks to stderr, and exits with nonzero status if any hunks fail.

A file compared against /dev/null (or with a date <= the epoch) is
created/deleted as appropriate.


pgrep

usage: pgrep [-Lcfnovx] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,] [-d DELIM] [-L SIGNAL] [PATTERN]

Search for process(es). PATTERN is an extended regular expression checked
against command names.
-G	Match real Group ID(s)
-L	Send SIGNAL instead of printing name
-P	Match Parent Process ID(s)
-U	Match real User ID(s)
-c	Show only count of matches
-d	Use DELIM instead of newline
-f	Check full command line for PATTERN
-g	Match Process Group(s) (0 is current user)
-l	Show command name
-n	Newest match only
-o	Oldest match only
-s	Match Session ID(s) (0 for current)
-t	Match Terminal(s)
-u	Match effective User ID(s)
-v	Negate the match
-x	Match whole command (not substring)

pidof

usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...

Print the PIDs of all processes with the given names.

-s	single shot, only return one pid.
-o	omit PID(s)


ping

usage: ping [OPTIONS] HOST

Check network connectivity by sending packets to a host and reporting
its response.

Send ICMP ECHO_REQUEST packets to ipv4 or ipv6 addresses and prints each
echo it receives back, with round trip time.

Options:
-4, -6      Force IPv4 or IPv6
-c CNT      Send CNT many packets
-I IFACE/IP Source interface or address
-q          Quiet, only displays output at start and when finished
-s SIZE     Packet SIZE in bytes (default 56)
-t TTL      Set Time (number of hops) To Live
-W SEC      Seconds to wait for response after all packets sent (default 10)
-w SEC      Exit after this many seconds


pivot_root

usage: pivot_root OLD NEW

Swap OLD and NEW filesystems (as if by simultaneous mount --move), and
move all processes with chdir or chroot under OLD into NEW (including
kernel threads) so OLD may be unmounted.

The directory NEW must exist under OLD. This doesn't work on initramfs,
which can't be moved (about the same way PID 1 can't be killed; see
switch_root instead).


pkill

usage: pkill [-l SIGNAL] [PATTERN]

-l	SIGNAL to send
-V	verbose


pmap

usage: pmap [-xq] [pids...]

Reports the memory map of a process or processes.

-x Show the extended format.
-q Do not display some header/footer lines.


poweroff

usage: reboot/halt/poweroff [-fn]

Restart, halt or powerdown the system.

-f	Don't signal init
-n	Don't sync before stopping the system.


printenv

usage: printenv [-0] [env_var...]

Print environment variables.

-0	Use \0 as delimiter instead of \n


printf

usage: printf FORMAT [ARGUMENT...]

Format and print ARGUMENT(s) according to FORMAT, using C printf syntax
(% escapes for cdeEfgGiosuxX, \ escapes for abefnrtv0 or \OCTAL or \xHEX).


ps

usage: ps [-AadeflnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]

List processes.

Which processes to show (selections may be comma separated lists):

-A	All processes
-a	Processes with terminals that aren't session leaders
-d	All processes that aren't session leaders
-e	Same as -A
-g	Belonging to GROUPs
-G	Belonging to real GROUPs (before sgid)
-p	PIDs (--pid)
-P	Parent PIDs (--ppid)
-s	In session IDs
-t	Attached to selected TTYs
-u	Owned by USERs
-U	Owned by real USERs (before suid)

Output modifiers:

-k	Sort FIELDs in +increasing or -decreasting order (--sort)
-M	Measure field widths (expanding as necessary)
-n	Show numeric USER and GROUP
-w	Wide output (don't truncate at terminal width)

Which FIELDs to show. (Default = -o PID,TTY,TIME,CMD)

-f	Full listing (-o USER:8=UID,PID,PPID,C,STIME,TTY,TIME,CMD)
-l	Long listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD)
-o	Output FIELDs instead of defaults, each with optional :size and =title
-O  Add FIELDS to defaults
-Z	Include LABEL

Available -o FIELDs:

  ADDR  Instruction pointer               ARGS    Command line (argv[] -path)
  CMD   COMM without -f, ARGS with -f     CMDLINE Command line (argv[])
  COMM  Original command name             COMMAND Original command path
  CPU   Which processor running on        ETIME   Elapsed time since PID start
  F     Flags (1=FORKNOEXEC 4=SUPERPRIV)  GID     Group id
  GROUP Group name                        LABEL   Security label
  MAJFL Major page faults                 MINFL   Minor page faults
  NAME  Command name (argv[0])            NI      Niceness (lower is faster)
  PCPU  Percentage of CPU time used       PGID    Process Group ID
  PID   Process ID                        PPID    Parent Process ID
  PRI   Priority (higher is faster)       PSR     Processor last executed on
  RGID  Real (before sgid) group ID       RGROUP  Real (before sgid) group name
  RSS   Resident Set Size (pages in use)  RTPRIO  Realtime priority
  RUID  Real (before suid) user ID        RUSER   Real (before suid) user name
  S     Process state:
        R (running) S (sleeping) D (device I/O) T (stopped)  t (traced)
        Z (zombie)  X (deader)   x (dead)       K (wakekill) W (waking)
  SCHED Scheduling policy (0=other, 1=fifo, 2=rr, 3=batch, 4=iso, 5=idle)
  STAT  Process state (S) plus:
        < high priority          N low priority L locked memory
        s session leader         + foreground   l multithreaded
  STIME Start time of process in hh:mm (size :19 shows yyyy-mm-dd hh:mm:ss)
  SZ    Memory Size (4k pages needed to completely swap out process)
  TIME  CPU time consumed                 TTY     Controlling terminal
  UID   User id                           USER    User name
  VSZ   Virtual memory size (1k units)    %VSZ    VSZ as % of physical memory
  WCHAN Waiting in kernel for


pwd

usage: pwd [-L|-P]

Print working (current) directory.

-L  Use shell's path from $PWD (when applicable)
-P  Print cannonical absolute path


pwdx

usage: pwdx PID...

Print working directory of processes listed on command line.


readahead

usage: readahead FILE...

Preload files into disk cache.


readlink

usage: readlink FILE

With no options, show what symlink points to, return error if not symlink.

Options for producing cannonical paths (all symlinks/./.. resolved):

-e	cannonical path to existing entry (fail if missing)
-f	full path (fail if directory missing)
-n	no trailing newline
-q	quiet (no output, just error code)


realpath

usage: realpath FILE...

Display the canonical absolute pathname


reboot

usage: reboot/halt/poweroff [-fn]

Restart, halt or powerdown the system.

-f	Don't signal init
-n	Don't sync before stopping the system.


renice

usage: renice [-gpu] -n increment ID ...


reset

usage: reset

reset the terminal


rev

usage: rev [FILE...]

Output each line reversed, when no files are given stdin is used.


rfkill

Usage: rfkill COMMAND [DEVICE]

Enable/disable wireless devices.

Commands:
list [DEVICE]   List current state
block DEVICE    Disable device
unblock DEVICE  Enable device

DEVICE is an index number, or one of:
all, wlan(wifi), bluetooth, uwb(ultrawideband), wimax, wwan, gps, fm.


rm

usage: rm [-fiRr] FILE...

Remove each argument from the filesystem.

-f	force: remove without confirmation, no error if it doesn't exist
-i	interactive: prompt for confirmation
-rR	recursive: remove directory contents


rmdir

usage: rmdir [-p] [dirname...]

Remove one or more directories.

-p	Remove path.


rmmod

usage: rmmod [-wf] [MODULE]

Unload the module named MODULE from the Linux kernel.
-f	Force unload of a module
-w	Wait until the module is no longer used.



route

usage: route [-ne] [-A inet[6]] / [add|del]

Display/Edit kernel routing tables.

-n	no name lookups
-e	display other/more information
-A	inet{6} Select Address Family

reject mod dyn reinstate metric netmask gw mss window irtt dev


sed

usage: sed [-inrE] [-e SCRIPT]...|SCRIPT [-f SCRIPT_FILE]... [FILE...]

Stream editor. Apply one or more editing SCRIPTs to each line of input
(from FILE or stdin) producing output (by default to stdout).

-e	add SCRIPT to list
-f	add contents of SCRIPT_FILE to list
-i	Edit each file in place.
-n	No default output. (Use the p command to output matched lines.)
-r	Use extended regular expression syntax.
-E	Alias for -r.
-s	Treat input files separately (implied by -i)

A SCRIPT is a series of one or more COMMANDs separated by newlines or
semicolons. All -e SCRIPTs are concatenated together as if separated
by newlines, followed by all lines from -f SCRIPT_FILEs, in order.
If no -e or -f SCRIPTs are specified, the first argument is the SCRIPT.

Each COMMAND may be preceded by an address which limits the command to
apply only to the specified line(s). Commands without an address apply to
every line. Addresses are of the form:

  [ADDRESS[,ADDRESS]]COMMAND

The ADDRESS may be a decimal line number (starting at 1), a /regular
expression/ within a pair of forward slashes, or the character "$" which
matches the last line of input. (In -s or -i mode this matches the last
line of each file, otherwise just the last line of the last file.) A single
address matches one line, a pair of comma separated addresses match
everything from the first address to the second address (inclusive). If
both addresses are regular expressions, more than one range of lines in
each file can match.

REGULAR EXPRESSIONS in sed are started and ended by the same character
(traditionally / but anything except a backslash or a newline works).
Backslashes may be used to escape the delimiter if it occurs in the
regex, and for the usual printf escapes (\abcefnrtv and octal, hex,
and unicode). An empty regex repeats the previous one. ADDRESS regexes
(above) require the first delimeter to be escaped with a backslash when
it isn't a forward slash (to distinguish it from the COMMANDs below).

Sed mostly operates on individual lines one at a time. It reads each line,
processes it, and either writes it to the output or discards it before
reading the next line. Sed can remember one additional line in a separate
buffer (using the h, H, g, G, and x commands), and can read the next line
of input early (using the n and N command), but other than that command
scripts operate on individual lines of text.

Each COMMAND starts with a single character. The following commands take
no arguments:

  {  Start a new command block, continuing until a corresponding "}".
     Command blocks may nest. If the block has an address, commands within
     the block are only run for lines within the block's address range.

  }  End command block (this command cannot have an address)

  d  Delete this line and move on to the next one
     (ignores remaining COMMANDs)

  D  Delete one line of input and restart command SCRIPT (same as "d"
     unless you've glued lines together with "N" or similar)

  g  Get remembered line (overwriting current line)

  G  Get remembered line (appending to current line)

  h  Remember this line (overwriting remembered line)

  H  Remember this line (appending to remembered line, if any)

  l  Print line, escaping \abfrtv (but not newline), octal escaping other
     nonprintable characters, wrapping lines to terminal width with a
     backslash, and appending $ to actual end of line.

  n  Print default output and read next line, replacing current line
     (If no next line available, quit processing script)

  N  Append next line of input to this line, separated by a newline
     (This advances the line counter for address matching and "=", if no
     next line available quit processing script without default output)

  p  Print this line

  P  Print this line up to first newline (from "N")

  q  Quit (print default output, no more commands processed or lines read)

  x  Exchange this line with remembered line (overwrite in both directions)

  =  Print the current line number (followed by a newline)

The following commands (may) take an argument. The "text" arguments (to
the "a", "b", and "c" commands) may end with an unescaped "\" to append
the next line (for which leading whitespace is not skipped), and also
treat ";" as a literal character (use "\;" instead).

  a [text]   Append text to output before attempting to read next line

  b [label]  Branch, jumps to :label (or with no label, to end of SCRIPT)

  c [text]   Delete line, output text at end of matching address range
             (ignores remaining COMMANDs)

  i [text]   Print text

  r [file]   Append contents of file to output before attempting to read
             next line.

  s/S/R/F    Search for regex S, replace matched text with R using flags F.
             The first character after the "s" (anything but newline or
             backslash) is the delimiter, escape with \ to use normally.

             The replacement text may contain "&" to substitute the matched
             text (escape it with backslash for a literal &), or \1 through
             \9 to substitute a parenthetical subexpression in the regex.
             You can also use the normal backslash escapes such as \n and
             a backslash at the end of the line appends the next line.

             The flags are:

             [0-9]    A number, substitute only that occurrence of pattern
             g        Global, substitute all occurrences of pattern
             i        Ignore case when matching
             p        Print the line if match was found and replaced
             w [file] Write (append) line to file if match replaced

  t [label]  Test, jump to :label only if an "s" command found a match in
             this line since last test (replacing with same text counts)

  T [label]  Test false, jump only if "s" hasn't found a match.

  w [file]   Write (append) line to file

  y/old/new/ Change each character in 'old' to corresponding character
             in 'new' (with standard backslash escapes, delimiter can be
             any repeated character except \ or \n)

  : [label]  Labeled target for jump commands

  #  Comment, ignore rest of this line of SCRIPT

Deviations from posix: allow extended regular expressions with -r,
editing in place with -i, separate with -s, printf escapes in text, line
continuations, semicolons after all commands, 2-address anywhere an
address is allowed, "T" command, multiline continuations for [abc],
\; to end [abc] argument before end of line.


seq

usage: seq [-w|-f fmt_str] [-s sep_str] [first] [increment] last

Count from first to last, by increment. Omitted arguments default
to 1. Two arguments are used as first and last. Arguments can be
negative or floating point.

-f	Use fmt_str as a printf-style floating point format string
-s	Use sep_str as separator, default is a newline character
-w	Pad to equal width with leading zeroes.


setsid

usage: setsid [-t] command [args...]

Run process in a new session.

-t	Grab tty (become foreground process, receiving keyboard signals)


sh

usage: sh [-c command] [script]

Command shell.  Runs a shell script, or reads input interactively
and responds to it.

-c	command line to execute
-i	interactive mode (default when STDIN is a tty)


sha1sum

usage: sha1sum [FILE]...

calculate sha1 hash for each input file, reading from stdin if none.
Output one hash (20 hex digits) for each input file, followed by
filename.

-b	brief (hash only, no filename)


shred

usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...

Securely delete a file by overwriting its contents with random data.

-f        Force (chmod if necessary)
-n COUNT  Random overwrite iterations (default 1)
-o OFFSET Start at OFFSET
-s SIZE   Use SIZE instead of detecting file size
-u        unlink (actually delete file when done)
-x        Use exact size (default without -s rounds up to next 4k)
-z        zero at end

Note: data journaling filesystems render this command useless, you must
overwrite all free space (fill up disk) to erase old data on those.


skeleton

usage: skeleton [-a] [-b STRING] [-c NUMBER] [-d LIST] [-e COUNT] [...]

Template for new commands. You don't need this.

When creating a new command, copy this file and delete the parts you
don't need. Be sure to replace all instances of "skeleton" (upper and lower
case) with your new command name.

For simple commands, "hello.c" is probably a better starting point.


skeleton_alias

usage: skeleton_alias [-dq] [-b NUMBER]

Example of a second command with different arguments in the same source
file as the first. This allows shared infrastructure not added to lib/.


sleep

usage: sleep LENGTH

Wait before exiting. An optional suffix can be "m" (minutes), "h" (hours),
"d" (days), or "s" (seconds, the default).



sort

usage: sort [-Mbcdfginrsuz] [-k#[,#[x]] [-t X]] [-o FILE] [FILE...]

Sort all lines of text from input files (or stdin) to stdout.

-M	month sort (jan, feb, etc).
-b	ignore leading blanks (or trailing blanks in second part of key)
-c	check whether input is sorted
-d	dictionary order (use alphanumeric and whitespace chars only)
-f	force uppercase (case insensitive sort)
-g	general numeric sort (double precision with nan and inf)
-i	ignore nonprinting characters
-k	sort by "key" (see below)
-n	numeric order (instead of alphabetical)
-o	output to FILE instead of stdout
-r	reverse
-s	skip fallback sort (only sort with keys)
-t	use a key separator other than whitespace
-u	unique lines only
-x	Hexadecimal numerical sort
-z	zero (null) terminated lines

Sorting by key looks at a subset of the words on each line.  -k2
uses the second word to the end of the line, -k2,2 looks at only
the second word, -k2,4 looks from the start of the second to the end
of the fourth word.  Specifying multiple keys uses the later keys as
tie breakers, in order.  A type specifier appended to a sort key
(such as -2,2n) applies only to sorting that key.

split

usage: split [-a SUFFIX_LEN] [-b BYTES] [-l LINES] [INPUT [OUTPUT]]

Copy INPUT (or stdin) data to a series of OUTPUT (or "x") files with
alphabetically increasing suffix (aa, ab, ac... az, ba, bb...).

-a	Suffix length (default 2)
-b	BYTES/file (10, 10k, 10m, 10g...)
-l	LINES/file (default 1000)


stat

usage: stat [-f] [-c FORMAT] FILE...

Display status of files or filesystems.

-f display filesystem status instead of file status
-c Output specified FORMAT string instead of default

The valid format escape sequences for files:
%a  Access bits (octal) |%A  Access bits (flags)|%b  Blocks allocated
%B  Bytes per block     |%d  Device ID (dec)    |%D  Device ID (hex)
%f  All mode bits (hex) |%F  File type          |%g  Group ID
%G  Group name          |%h  Hard links         |%i  Inode
%n  Filename            |%N  Long filename      |%o  I/O block size
%s  Size (bytes)        |%u  User ID            |%U  User name
%x  Access time         |%X  Access unix time   |%y  File write time
%Y  File write unix time|%z  Dir change time    |%Z  Dir change unix time

The valid format escape sequences for filesystems:
%a  Available blocks    |%b  Total blocks       |%c  Total inodes
%d  Free inodes         |%f  Free blocks        |%i  File system ID
%l  Max filename length |%n  File name          |%s  Fragment size
%S  Best transfer size  |%t  Filesystem type    |%T  Filesystem type name


strings

usage: strings [-fo] [-n LEN] [FILE...]

Display printable strings in a binary file

-f	Precede strings with filenames
-n	At least LEN characters form a string (default 4)
-o	Precede strings with decimal offsets


su

usage: su [-lmp] [-c CMD] [-s SHELL] [USER [ARGS...]]

Switch to user (or root) and run shell (with optional command line).

-s	shell to use
-c	command to pass to shell with -c
-l	login shell
-(m|p)	preserve environment


sulogin

usage: sulogin [-t time] [tty]

Single User Login.
-t	Default Time for Single User Login


swapoff

usage: swapoff swapregion

Disable swapping on a given swapregion.


swapon

usage: swapon [-d] [-p priority] filename

Enable swapping on a given device/file.

-d	Discard freed SSD pages


switch_root

usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT...

Use from PID 1 under initramfs to free initramfs, chroot to NEW_ROOT,
and exec NEW_INIT.

-c	Redirect console to device in NEW_ROOT
-h	Hang instead of exiting on failure (avoids kernel panic)


sync

usage: sync

Write pending cached data to disk (synchronize), blocking until done.


sysctl

usage: sysctl [-aAeNnqw] [-p [FILE] | KEY[=VALUE]...]

Read/write system control data (under /proc/sys).

-a,A	Show all values
-e	Don't warn about unknown keys
-N	Don't print key values
-n	Don't print key names
-p	Read values from FILE (default /etc/sysctl.conf)
-q	Don't show value after write
-w	Only write values (object to reading)


syslogd

usage: syslogd  [-a socket] [-O logfile] [-f config file] [-m interval]
                [-p socket] [-s SIZE] [-b N] [-R HOST] [-l N] [-nSLKD]

System logging utility

-a      Extra unix socket for listen
-O FILE Default log file 
-f FILE Config file 
-p      Alternative unix domain socket 
-n      Avoid auto-backgrounding.
-S      Smaller output
-m MARK interval  (RANGE: 0 to 71582787)
-R HOST Log to IP or hostname on PORT (default PORT=514/UDP)"
-L      Log locally and via network (default is network only if -R)"
-s SIZE Max size (KB) before rotation (default:200KB, 0=off)
-b N    rotated logs to keep (default:1, max=99, 0=purge)
-K      Log to kernel printk buffer (use dmesg to read it)
-l N    Log only messages more urgent than prio(default:8 max:8 min:1)
-D      Drop duplicates


tac

usage: tac [FILE...]

Output lines in reverse order.


tail

usage: tail [-n|c NUMBER] [-f] [FILE...]

Copy last lines from files to stdout. If no files listed, copy from
stdin. Filename "-" is a synonym for stdin.

-n	output the last NUMBER lines (default 10), +X counts from start.
-c	output the last NUMBER bytes, +NUMBER counts from start
-f	follow FILE(s), waiting for more data to be appended


tar

usage: tar -[cxtzhmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR]

Create, extract, or list files from a tar file

Operation:
c Create
f Name of TARFILE ('-' for stdin/out)
h Follow symlinks
m Don't restore mtime
t List
v Verbose
x Extract
z (De)compress using gzip
C Change to DIR before operation
O Extract to stdout
exclude=FILE File to exclude
X File with names to exclude
T File with names to include


taskset

usage: taskset [-ap] [mask] [PID | cmd [args...]]

Launch a new task which may only run on certain processors, or change
the processor affinity of an exisitng PID.

Mask is a hex string where each bit represents a processor the process
is allowed to run on. PID without a mask displays existing affinity.

-p	Set/get the affinity of given PID instead of a new command.
-a	Set/get the affinity of all threads of the PID.


tee

usage: tee [-ai] [file...]

Copy stdin to each listed file, and also to stdout.
Filename "-" is a synonym for stdout.

-a	append to files.
-i	ignore SIGINT.


telnet

usage: telnet HOST [PORT]

Connect to telnet server


telnetd

Handle incoming telnet connections

-l LOGIN  Exec LOGIN on connect
-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue
-K Close connection as soon as login exits
-p PORT   Port to listen on
-b ADDR[:PORT]  Address to bind to
-F Run in foreground
-i Inetd mode
-w SEC    Inetd 'wait' mode, linger time SEC
-S Log to syslog (implied by -i or without -F and -w)


test

usage: test [-bcdefghLPrSsuwx PATH] [-nz STRING] [-t FD] [X ?? Y]

Return true or false by performing tests. (With no arguments return false.)

--- Tests with a single argument (after the option):
PATH is/has:
  -b  block device   -f  regular file   -p  fifo           -u  setuid bit
  -c  char device    -g  setgid         -r  read bit       -w  write bit
  -d  directory      -h  symlink        -S  socket         -x  execute bit
  -e  exists         -L  symlink        -s  nonzero size
STRING is:
  -n  nonzero size   -z  zero size      (STRING by itself implies -n)
FD (integer file descriptor) is:
  -t  a TTY

--- Tests with one argument on each side of an operator:
Two strings:
  =  are identical	 !=  differ
Two integers:
  -eq  equal         -gt  first > second    -lt  first < second
  -ne  not equal     -ge  first >= second   -le  first <= second

--- Modify or combine tests:
  ! EXPR     not (swap true/false)   EXPR -a EXPR    and (are both true)
  ( EXPR )   evaluate this first     EXPR -o EXPR    or (is either true)


test_human_readable

usage: test_human_readable [-sbi] NUMBER


test_many_options

usage: test_many_options -[a-zA-Z]

Print the optflags value of the command arguments, in hex.


test_scankey

usage: test_scankey

Move a letter around the screen. Hit ESC to exit.



tftp

usage: tftp [OPTIONS] HOST [PORT]

Transfer file from/to tftp server.

-l FILE Local FILE
-r FILE Remote FILE
-g    Get file
-p    Put file
-b SIZE Transfer blocks of SIZE octets(8 <= SIZE <= 65464)


tftpd

usage: tftpd [-cr] [-u USER] [DIR]

Transfer file from/to tftp server.

-r	read only
-c	Allow file creation via upload
-u	run as USER
-l	Log to syslog (inetd mode requires this)


time

usage: time [-p] COMMAND [ARGS...]

Run command line and report real, user, and system time elapsed in seconds.
(real = clock on the wall, user = cpu used by command's code,
system = cpu used by OS on behalf of command.)

-p	posix mode (ignored)


timeout

usage: timeout [-k LENGTH] [-s SIGNAL] LENGTH COMMAND...

Run command line as a child process, sending child a signal if the
command doesn't exit soon enough.

Length can be a decimal fraction. An optional suffix can be "m"
(minutes), "h" (hours), "d" (days), or "s" (seconds, the default).

-s	Send specified signal (default TERM)
-k	Send KILL signal if child still running this long after first signal.
-v	Verbose


top

usage: top [-m] [ -d seconds ] [ -n iterations ]

Show process activity in real time.

-k	Fallback sort FIELDS (default -S,-%CPU,-ETIME,-PID)
-o	Show FIELDS (def PID,USER,PR,NI,VIRT,RES,SHR,S,%CPU,%MEM,TIME+,CMDLINE)
-s	Sort by field number (1-X, default 9)


touch

usage: touch [-amch] [-d DATE] [-t TIME] [-r FILE] FILE...

Update the access and modification times of each FILE to the current time.

-a	change access time
-m	change modification time
-c	don't create file
-h	change symlink
-d	set time to DATE (in YYYY-MM-DDThh:mm:SS[.frac][tz] format)
-t	set time to TIME (in [[CC]YY]MMDDhhmm[.ss][frac] format)
-r	set time same as reference FILE


toysh

usage: sh [-c command] [script]

Command shell.  Runs a shell script, or reads input interactively
and responds to it.

-c	command line to execute
-i	interactive mode (default when STDIN is a tty)


tr

usage: tr [-cds] SET1 [SET2]

Translate, squeeze, or delete characters from stdin, writing to stdout

-c/-C  Take complement of SET1
-d     Delete input characters coded SET1
-s     Squeeze multiple output characters of SET2 into one character


traceroute

usage: traceroute [-46FUIldnvr] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES]
[-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE] [-z PAUSE_MSEC] HOST [BYTES]

traceroute6 [-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES][-s SRC_IP] [-t TOS] [-w WAIT_SEC]
  [-i IFACE] HOST [BYTES]

Trace the route to HOST

-4,-6 Force IP or IPv6 name resolution
-F    Set the don't fragment bit (supports IPV4 only)
-U    Use UDP datagrams instead of ICMP ECHO (supports IPV4 only)
-I    Use ICMP ECHO instead of UDP datagrams (supports IPV4 only)
-l    Display the TTL value of the returned packet (supports IPV4 only)
-d    Set SO_DEBUG options to socket
-n    Print numeric addresses
-v    verbose
-r    Bypass routing tables, send directly to HOST
-m    Max time-to-live (max number of hops)(RANGE 1 to 255)
-p    Base UDP port number used in probes(default 33434)(RANGE 1 to 65535)
-q    Number of probes per TTL (default 3)(RANGE 1 to 255)
-s    IP address to use as the source address
-t    Type-of-service in probe packets (default 0)(RANGE 0 to 255)
-w    Time in seconds to wait for a response (default 3)(RANGE 0 to 86400)
-g    Loose source route gateway (8 max) (supports IPV4 only)
-z    Pause Time in milisec (default 0)(RANGE 0 to 86400) (supports IPV4 only)
-f    Start from the 1ST_TTL hop (instead from 1)(RANGE 1 to 255) (supports IPV4 only)
-i    Specify a network interface to operate with


traceroute6

usage: traceroute [-46FUIldnvr] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES]
[-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE] [-z PAUSE_MSEC] HOST [BYTES]

traceroute6 [-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES][-s SRC_IP] [-t TOS] [-w WAIT_SEC]
  [-i IFACE] HOST [BYTES]

Trace the route to HOST

-4,-6 Force IP or IPv6 name resolution
-F    Set the don't fragment bit (supports IPV4 only)
-U    Use UDP datagrams instead of ICMP ECHO (supports IPV4 only)
-I    Use ICMP ECHO instead of UDP datagrams (supports IPV4 only)
-l    Display the TTL value of the returned packet (supports IPV4 only)
-d    Set SO_DEBUG options to socket
-n    Print numeric addresses
-v    verbose
-r    Bypass routing tables, send directly to HOST
-m    Max time-to-live (max number of hops)(RANGE 1 to 255)
-p    Base UDP port number used in probes(default 33434)(RANGE 1 to 65535)
-q    Number of probes per TTL (default 3)(RANGE 1 to 255)
-s    IP address to use as the source address
-t    Type-of-service in probe packets (default 0)(RANGE 0 to 255)
-w    Time in seconds to wait for a response (default 3)(RANGE 0 to 86400)
-g    Loose source route gateway (8 max) (supports IPV4 only)
-z    Pause Time in milisec (default 0)(RANGE 0 to 86400) (supports IPV4 only)
-f    Start from the 1ST_TTL hop (instead from 1)(RANGE 1 to 255) (supports IPV4 only)
-i    Specify a network interface to operate with


true

Return zero.


truncate

usage: truncate [-c] -s SIZE file...

Set length of file(s), extending sparsely if necessary.

-c	Don't create file if it doesn't exist.
-s	New size (with optional prefix and suffix)

SIZE prefix: + add, - subtract, < shrink to, > expand to,
             / multiple rounding down, % multiple rounding up
SIZE suffix: k=1024, m=1024^2, g=1024^3, t=1024^4, p=1024^5, e=1024^6


tty

usage: tty [-s]

Show filename of terminal connected to stdin.

Prints "not a tty" and exits with nonzero status if no terminal
is connected to stdin.

-s	silent, exit code only


ulimit

usage: ulimit [-P PID] [-SHRacdefilmnpqrstuv] [LIMIT]

Print or set resource limits for process number PID. If no LIMIT specified
(or read-only -ap selected) display current value (sizes in bytes).
Default is ulimit -P $PPID -Sf" (show soft filesize of your shell).

-S  Set/show soft limit          -H  Set/show hard (maximum) limit
-a  Show all limits              -c  Core file size
-d  Process data segment         -e  Max scheduling priority
-f  Output file size             -i  Pending signal count
-l  Locked memory                -m  Resident Set Size
-n  Number of open files         -p  Pipe buffer
-q  Posix message queue          -r  Max Real-time priority
-R  Realtime latency (usec)      -s  Stack size
-t  Total CPU time (in seconds)  -u  Maximum processes (under this UID)
-v  Virtual memory size          -P  PID to affect (default $PPID)


umount

usage: umount [-a [-t TYPE[,TYPE...]]] [-vrfD] [DIR...]

Unmount the listed filesystems.

-a	Unmount all mounts in /proc/mounts instead of command line list
-D  Don't free loopback device(s).
-f  Force unmount.
-l  Lazy unmount (detach from filesystem now, close when last user does).
-n	Don't use /proc/mounts
-r  Remount read only if unmounting fails.
-t	Restrict "all" to mounts of TYPE (or use "noTYPE" to skip)
-v	Verbose



uname

usage: uname [-asnrvm]

Print system information.

-s	System name
-n	Network (domain) name
-r	Kernel Release number
-v	Kernel Version
-m	Machine (hardware) name
-a	All of the above


uniq

usage: uniq [-cduiz] [-w maxchars] [-f fields] [-s char] [input_file [output_file]]

Report or filter out repeated lines in a file

-c	show counts before each line
-d	show only lines that are repeated
-u	show only lines that are unique
-i	ignore case when comparing lines
-z	lines end with \0 not \n
-w	compare maximum X chars per line
-f	ignore first X fields
-s	ignore first X chars


unix2dos

usage: unix2dos [FILE...]

Convert newline format from unix "\n" to dos "\r\n".
If no files listed copy from stdin, "-" is a synonym for stdin.


unlink

usage: unlink FILE

Deletes one file.


unshare

usage: unshare [-imnpuUr] COMMAND...

Create new container namespace(s) for this process and its children, so
some attribute is not shared with the parent process.

-f  Fork command in the background (--fork)
-i	SysV IPC (message queues, semaphores, shared memory) (--ipc)
-m	Mount/unmount tree (--mount)
-n	Network address, sockets, routing, iptables (--net)
-p	Process IDs and init (--pid)
-r	Become root (map current euid/egid to 0/0, implies -U) (--map-root-user)
-u	Host and domain names (--uts)
-U	UIDs, GIDs, capabilities (--user)

A namespace allows a set of processes to have a different view of the
system than other sets of processes.


uptime

usage: uptime

Tell how long the system has been running and the system load
averages for the past 1, 5 and 15 minutes.


useradd

usage: useradd [-SDH] [-h DIR] [-s SHELL] [-G GRP] [-g NAME] [-u UID] USER [GROUP]

Create new user, or add USER to GROUP

-D       Don't assign a password
-g NAME  Real name
-G GRP   Add user to existing group
-h DIR   Home directory
-H       Don't create home directory
-s SHELL Login shell
-S       Create a system user
-u UID   User id


userdel

usage: userdel [-r] USER
usage: deluser [-r] USER

Options:
-r remove home directory
Delete USER from the SYSTEM


usleep

usage: usleep MICROSECONDS

Pause for MICROSECONDS microseconds.


uudecode

usage: uudecode [-o OUTFILE] [INFILE]

Decode file from stdin (or INFILE).

-o	write to OUTFILE instead of filename in header


uuencode

usage: uuencode [-m] [file] encode-filename

Uuencode stdin (or file) to stdout, with encode-filename in the output.

-m	base64-encode


vconfig

usage: vconfig COMMAND [OPTIONS]

Create and remove virtual ethernet devices

add             [interface-name] [vlan_id]
rem             [vlan-name]
set_flag        [interface-name] [flag-num]       [0 | 1]
set_egress_map  [vlan-name]      [skb_priority]   [vlan_qos]
set_ingress_map [vlan-name]      [skb_priority]   [vlan_qos]
set_name_type   [name-type]


vi

usage: vi FILE

Visual text editor. Predates the existence of standardized cursor keys,
so the controls are weird and historical.


vmstat

usage: vmstat [-n] [DELAY [COUNT]]

Print virtual memory statistics, repeating each DELAY seconds, COUNT times.
(With no DELAY, prints one line. With no COUNT, repeats until killed.)

Show processes running and blocked, kilobytes swapped, free, buffered, and
cached, kilobytes swapped in and out per second, file disk blocks input and
output per second, interrupts and context switches per second, percent
of CPU time spent running user code, system code, idle, and awaiting I/O.
First line is since system started, later lines are since last line.

-n	Display the header only once


w

usage: w

Show who is logged on and since how long they logged in.


watch

usage: watch [-n SEC] [-t] PROG ARGS

Run PROG periodically

-n  Loop period in seconds (default 2)
-t  Don't print header
-e  Freeze updates on command error, and exit after enter.


wc

usage: wc -lwcm [FILE...]

Count lines, words, and characters in input.

-l	show lines
-w	show words
-c	show bytes
-m	show characters

By default outputs lines, words, bytes, and filename for each
argument (or from stdin if none). Displays only either bytes
or characters.


wget

usage: wget -f filename URL
-f filename: specify the filename to be saved
URL: HTTP uniform resource location and only HTTP, not HTTPS

examples:
  wget -f index.html http://www.example.com
  wget -f sample.jpg http://www.example.com:8080/sample.jpg


which

usage: which [-a] filename ...

Search $PATH for executable files matching filename(s).

-a	Show all matches


who

usage: who

Print logged user information on system


whoami

usage: logname

Print the current user name.


xargs

usage: xargs [-ptxr0] [-s NUM] [-n NUM] [-L NUM] [-E STR] COMMAND...

Run command line one or more times, appending arguments from stdin.

If command exits with 255, don't launch another even if arguments remain.

-s	Size in bytes per command line
-n	Max number of arguments per command
-0	Each argument is NULL terminated, no whitespace or quote processing
#-p	Prompt for y/n from tty before running each command
#-t	Trace, print command line to stderr
#-x	Exit if can't fit everything in one command
#-r	Don't run command with empty input
#-L	Max number of lines of input per command
-E	stop at line matching string


xxd

usage: xxd [-c n] [-g n] [-l n] [-p] [-r] [file]

Hexdump a file to stdout.  If no file is listed, copy from stdin.
Filename "-" is a synonym for stdin.

-c n	Show n bytes per line (default 16).
-g n	Group bytes by adding a ' ' every n bytes (default 2).
-l n	Limit of n bytes before stopping (default is no limit).
-p	Plain hexdump (30 bytes/line, no grouping).
-r	Reverse operation: turn a hexdump into a binary file.


xzcat

usage: xzcat [filename...]

Decompress listed files to stdout. Use stdin if no files listed.




yes

usage: yes [args...]

Repeatedly output line until killed. If no args, output 'y'.



zcat

usage: zcat [FILE...]

Decompress deflated file(s) to stdout