Professional Documents
Culture Documents
Toybox 0.8
Toybox 0.8
toybox
usage: toybox [--long | --help | --version | [command] [arguments...]]
The filename "-" means stdin/stdout, and "--" stops argument parsing.
Durations can be decimal fractions and accept minute ("m"), hour ("h"),
or day ("d") suffixes (so 0.1m = 6s).
:
Return zero.
acpi
usage: acpi [-abctV]
ascii
usage: ascii
base64
usage: base64 [-di] [-w COLUMNS] [FILE...]
-d Decode
-i Ignore non-alphabetic characters
-w Wrap output at COLUMNS (default 76 or 0 for no wrap)
basename
usage: basename [-a] [-s SUFFIX] NAME... | NAME [SUFFIX]
blkid
usage: blkid [-UL] DEV...
blockdev
usage: blockdev --OPTION... BLOCKDEV...
bunzip2
usage: bunzip2 [-cftkv] [FILE...]
bzcat
usage: bzcat [FILE...]
cal
usage: cal [[month] year]
Print a calendar.
cat
usage: cat [-u] [file...]
catv
usage: catv [-evt] [filename...]
chattr
usage: chattr [-R] [-+=AacDdijsStTu] [-v version] [File...]
-R Recurse
-v Set the file's version/generation number
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
chgrp
usage: chgrp/chown [-RHLP] [-fvh] group file...
chmod
usage: chmod [-R] MODE FILE...
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...
chroot
usage: chroot NEWROOT [COMMAND [ARG...]]
chrt
usage: chrt [-Rmofrbi] {-p PID [PRIORITY] | [PRIORITY COMMAND...]}
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.
clear
Clear the screen.
cmp
usage: cmp [-l] [-s] FILE1 FILE2
comm
usage: comm [-123] FILE1 FILE2
Read FILE1 and FILE2, which should be ordered, and produce three text
columns as output: lines only in FILE1; lines only in FILE2; and lines
in both files. Filename "-" is a synonym for stdin.
count
usage: count
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
-D Create leading dirs under DEST (--parents)
--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.
crc32
usage: crc32 [file...]
cut
usage: cut [-Ds] [-bcfF LIST] [-dO DELIM] [FILE...]
-b Select bytes
-c Select UTF-8 characters
-C Select unicode columns
-d Use DELIM (default is TAB for -f, run of whitespace for -F)
-D Don't sort/collate selections or match -fF lines without delimiter
-f Select fields (words) separated by single DELIM character
-F Select fields separated by DELIM regex
-O Output delimiter (default one space for -F, input delim for -f)
-s Skip lines without delimiters
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.
MMDDhhmm[[CC]YY][.ss] POSIX
@UNIXTIME[.FRACTION] seconds since midnight 1970-01-01
YYYY-MM-DD [hh:mm[:ss]] ISO 8601
hh:mm[:ss] 24-hour time today
All input formats can be preceded by TZ="id" to set the input time zone
separately from the output time zone. Otherwise $TZ sets both.
%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)
devmem
usage: devmem ADDR [WIDTH [DATA]]
df
usage: df [-HPkhi] [-t type] [FILESYSTEM ...]
dirname
usage: dirname PATH...
dmesg
usage: dmesg [-Cc] [-r|-t|-T] [-n LEVEL] [-s SIZE] [-w]
dos2unix
usage: dos2unix [FILE...]
du
usage: du [-d N] [-askxHLlmc] [file...]
Size in:
-k 1024 byte blocks (default)
-K 512 byte blocks (posix)
-m Megabytes
-h Human readable (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
echo
usage: echo [-neE] [args...]
Write each argument to stdout, with one space between each, followed
by a newline.
-n No trailing newline
-E Print escape sequences literally (default)
-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 [-EFrivwcloqsHbhn] [-ABC NUM] [-m MAX] [-e REGEX]... [-MS PATTERN]... [-f REGFILE] [FILE]...
file search:
-r Recurse into subdirectories (defaults FILE to ".")
-M Match filename pattern (--include)
-S Skip filename pattern (--exclude)
--exclude-dir=PATTERN Skip directory pattern
-I Ignore binary files
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) -a always text (not binary)
-i case insensitive -m match MAX many lines
-v invert match -w whole word (implies -E)
-x whole line -z input NUL terminated
eject
usage: eject [-stT] [DEVICE]
-s SCSI device
-t Close tray
-T Open/close tray (toggle)
env
usage: env [-i] [-u NAME] [NAME=VALUE...] [COMMAND [ARG...]]
expand
usage: expand [-t TABLIST] [FILE...]
-t TABLIST
factor
usage: factor NUMBER...
Factor integers.
fallocate
usage: fallocate [-l size] [-o offset] file
false
Return nonzero.
fgrep
usage: grep [-EFrivwcloqsHbhn] [-ABC NUM] [-m MAX] [-e REGEX]... [-MS PATTERN]... [-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, 2 for command errors.
file search:
-r Recurse into subdirectories (defaults FILE to ".")
-M Match filename pattern (--include)
-S Skip filename pattern (--exclude)
--exclude-dir=PATTERN Skip directory pattern
-I Ignore binary files
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) -a always text (not binary)
-i case insensitive -m match MAX many lines
-v invert match -w whole word (implies -E)
-x whole line -z input NUL terminated
file
usage: file [-hL] [file...]
find
usage: find [-HL] [DIR...] []
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[u] accessed N units ago
-ctime N[u] created N units ago -mtime N[u] modified N units 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)
-context PATTERN security context
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
-printf FORMAT Print using format string
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
-s Shared lock
-x Exclusive lock (default)
-u Unlock
-n Non-blocking: fail rather than wait for the lock
fmt
usage: fmt [-w WIDTH] [FILE...]
free
usage: free [-bkmgt]
Display the total, free and used amount of physical memory and swap space.
freeramdisk
usage: freeramdisk [RAM device]
fsfreeze
usage: fsfreeze {-f | -u} MOUNTPOINT
-f Freeze
-u Unfreeze
fstype
usage: fstype DEV...
fsync
usage: fsync [-d] [FILE...]
ftpget
usage: ftpget [-cvgslLmMdD] [-P PORT] [-p PASSWORD] [-u USER] HOST [LOCAL] REMOTE
Talk to ftp server. By default get REMOTE file via passive anonymous
transfer, optionally saving under a LOCAL name. Can also send, list, etc.
ftpput
usage: ftpget [-cvgslLmMdD] [-P PORT] [-p PASSWORD] [-u USER] HOST [LOCAL] REMOTE
Talk to ftp server. By default get REMOTE file via passive anonymous
transfer, optionally saving under a LOCAL name. Can also send, list, etc.
getconf
usage: getconf -a [PATH] | -l | NAME [PATH]
grep
usage: grep [-EFrivwcloqsHbhn] [-ABC NUM] [-m MAX] [-e REGEX]... [-MS PATTERN]... [-f REGFILE] [FILE]...
file search:
-r Recurse into subdirectories (defaults FILE to ".")
-M Match filename pattern (--include)
-S Skip filename pattern (--exclude)
--exclude-dir=PATTERN Skip directory pattern
-I Ignore binary files
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) -a always text (not binary)
-i case insensitive -m match MAX many lines
-v invert match -w whole word (implies -E)
-x whole line -z input NUL terminated
groups
usage: groups [user]
gunzip
usage: gunzip [-cfk] [FILE...]
halt
usage: reboot/halt/poweroff [-fn]
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
-c Number of bytes to copy
-q Never print headers
-v Always print headers
help
usage: help [-ah] [command]
-h HTML output
-a All commands
hexedit
usage: hexedit FILENAME
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
hostname
usage: hostname [-bdsf] [-F FILENAME] [newname]
hwclock
usage: hwclock [-rswtluf]
i2cdetect
usage: i2cdetect [-ary] BUS [FIRST LAST]
usage: i2cdetect -F BUS
usage: i2cdetect -l
i2cdump
usage: i2cdump [-fy] BUS CHIP
i2cget
usage: i2cget [-fy] BUS CHIP ADDR
i2cset
usage: i2cset [-fy] BUS CHIP ADDR VALUE... MODE
Write an i2c register. MODE is b for byte, w for 16-bit word, i for I2C block.
iconv
usage: iconv [-f FROM] [-t TO] [FILE...]
id
usage: id [-nGgru] [USER...]
ifconfig
usage: ifconfig [-aS] [INTERFACE [ACTION...]]
Flags you can set on an interface (or -remove by prefixing with -):
inotifyd
usage: inotifyd PROG FILE[:MASK] ...
When a filesystem event matching MASK occurs to a FILE, run PROG as:
When x event happens for all FILEs, inotifyd exits (after waiting for PROG).
insmod
usage: insmod MODULE [MODULE_OPTIONS]
install
usage: install [-dDpsv] [-o USER] [-g GROUP] [-m MODE] [SOURCE...] DEST
ionice
usage: ionice [-t] [-c CLASS] [-n LEVEL] [COMMAND...|-p PID]
iorenice
usage: iorenice PID [CLASS] [PRIORITY]
iotop
usage: iotop [-AaKObq] [-n NUMBER] [-d SECONDS] [-p PID,] [-u USER,]
kill
usage: kill [-l [SIGNAL] | -s SIGNAL | -SIGNAL] pid...
killall
usage: killall [-l] [-iqv] [-SIGNAL|-s SIGNAL] PROCESS_NAME...
Send a signal (default: TERM) to all processes with the given names.
killall5
usage: killall5 [-l [SIGNAL]] [-SIGNAL|-s SIGNAL] [-o PID]...
link
usage: link FILE NEWLINK
ln
usage: ln [-sfnv] [FROM...] TO
logger
usage: logger [-s] [-t TAG] [-p [FACILITY.]PRIORITY] [message...]
login
usage: login [-p] [-h host] [-f USERNAME] [USERNAME]
-p Preserve environment
-h The name of the remote host for this login
-f login as USERNAME without authentication
logname
usage: logname
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 association at OFFSET into FILE
-r Read only
-S Limit SIZE of loopback association (alias --sizelimit)
ls
usage: ls [-ACFHLRSZacdfhiklmnpqrstux1] [--color[=auto]] [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 -p put a '/' after dir names
-q unprintable chars as '?' -s storage used (1024 byte units)
-u use access time for timestamps -A list all files but . and ..
-H follow command line symlinks -L follow symlinks
-R recursively list 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) -ll long with nanoseconds (--full-time)
--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...]
lsmod
usage: lsmod
Display the currently loaded modules, their sizes and their dependencies.
lspci
usage: lspci [-ekmn] [-i FILE ]
lsusb
usage: lsusb
makedevs
usage: makedevs [-d device_table] rootdir
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 '-'.
mcookie
usage: mcookie [-vV]
md5sum
usage: md5sum [-bcs] [FILE]...
Calculate md5 hash for each input file, reading from stdin if none.
Output one hash (32 hex digits) for each input file, followed by filename.
microcom
usage: microcom [-s SPEED] [-X] DEVICE
mix
usage: mix [-d DEV] [-c CHANNEL] [-l VOL] [-r RIGHT]
mkdir
usage: mkdir [-vp] [-m mode] [dirname...]
mkfifo
usage: mkfifo [NAME...]
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).
mkpasswd
usage: mkpasswd [-P FD] [-m TYPE] [-S SALT] [PASSWORD] [SALT]
mkswap
usage: mkswap [-L LABEL] DEVICE
mktemp
usage: mktemp [-dqu] [-p DIR] [TEMPLATE]
modinfo
usage: modinfo [-0] [-b basedir] [-k kernrelease] [-F field] [modulename...]
mount
usage: mount [-afFrsvw] [-t TYPE] [-o OPTION,] [[DEVICE] DIR]
-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
mountpoint
usage: mountpoint [-qd] DIR
mountpoint [-qx] DEVICE
mv
usage: mv [-fivn] SOURCE... DEST
nbd-client
usage: nbd-client [-ns] HOST PORT DEVICE
nbd_client
usage: nbd-client [-ns] HOST PORT DEVICE
nc
usage: netcat [-46t] [-lL COMMAND...] [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}
-4 Force IPv4
-6 Force IPv6
-L Listen for multiple incoming connections (server mode)
-W SECONDS timeout for more data on an idle connection
-f Use FILENAME (ala /dev/ttyS0) instead of network
-l Listen for one incoming connection
-p Local port number
-q Quit SECONDS after EOF on stdin, even if stdout hasn't closed yet
-s Local source address
-t Allocate tty (must come before -l or -L)
-u Use UDP
-w SECONDS timeout to establish connection
Use "stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho" with
netcat -f to connect to a serial port.
netcat
usage: netcat [-46t] [-lL COMMAND...] [-u] [-wpq #] [-s addr] {IPADDR PORTNUM|-f FILENAME}
-4 Force IPv4
-6 Force IPv6
-L Listen for multiple incoming connections (server mode)
-W SECONDS timeout for more data on an idle connection
-f Use FILENAME (ala /dev/ttyS0) instead of network
-l Listen for one incoming connection
-p Local port number
-q Quit SECONDS after EOF on stdin, even if stdout hasn't closed yet
-s Local source address
-t Allocate tty (must come before -l or -L)
-u Use UDP
-w SECONDS timeout to establish connection
Use "stty 115200 -F /dev/ttyS0 && stty raw -echo -ctlecho" with
netcat -f to connect to a serial port.
netstat
usage: netstat [-pWrxwutneal]
-r Routing table
-a All sockets (not just connected)
-l Listening server sockets
-t TCP sockets
-u UDP sockets
-w Raw sockets
-x Unix sockets
-e Extended info
-n Don't resolve names
-W Wide display
-p Show PID/program name of sockets
nice
usage: nice [-n PRIORITY] COMMAND [ARG...]
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...]
nohup
usage: nohup COMMAND [ARG...]
nproc
usage: nproc [--all]
--all Show all processors, not just ones this task can run on
od
usage: od [-bcdosxv] [-j #] [-N #] [-w #] [-A doxn] [-t acdfoux[#]]
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).
partprobe
usage: partprobe DEVICE...
Ask the kernel to re-read the partition table on the specified devices.
passwd
usage: passwd [-a ALGO] [-dlu] [USER]
paste
usage: paste [-s] [-d DELIMITERS] [FILE...]
patch
usage: patch [-d DIR] [-i file] [-p depth] [-Rlsu] [--dry-run]
This version of patch only handles unified diffs, and only modifies
a file when 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 [-clfnovx] [-d DELIM] [-L SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]
pidof
usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...
ping
usage: ping [OPTIONS] HOST
Send ICMP ECHO_REQUEST packets to ipv4 or ipv6 addresses and prints each
echo it receives back, with round trip time. Returns true if host alive.
Options:
-4, -6 Force IPv4 or IPv6
-c CNT Send CNT many packets (default 3, 0 = infinite)
-f Flood (print . and \b to show drops, default -c 15 -i 0.2)
-i TIME Interval between packets (default 1, need root for < .2)
-I IFACE/IP Source interface or address
-m MARK Tag outgoing packets using SO_MARK
-q Quiet (stops after one returns true if host is alive)
-s SIZE Data SIZE in bytes (default 56)
-t TTL Set Time To Live (number of hops)
-W SEC Seconds to wait for response after last -c packet (default 3)
-w SEC Exit after this many seconds
ping6
usage: ping [OPTIONS] HOST
Send ICMP ECHO_REQUEST packets to ipv4 or ipv6 addresses and prints each
echo it receives back, with round trip time. Returns true if host alive.
Options:
-4, -6 Force IPv4 or IPv6
-c CNT Send CNT many packets (default 3, 0 = infinite)
-f Flood (print . and \b to show drops, default -c 15 -i 0.2)
-i TIME Interval between packets (default 1, need root for < .2)
-I IFACE/IP Source interface or address
-m MARK Tag outgoing packets using SO_MARK
-q Quiet (stops after one returns true if host is alive)
-s SIZE Data SIZE in bytes (default 56)
-t TTL Set Time To Live (number of hops)
-W SEC Seconds to wait for response after last -c packet (default 3)
-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 [-fnovx] [-SIGNAL|-l SIGNAL] [PATTERN] [-G GID,] [-g PGRP,] [-P PPID,] [-s SID,] [-t TERM,] [-U UID,] [-u EUID,]
pmap
usage: pmap [-xq] [pids...]
poweroff
usage: reboot/halt/poweroff [-fn]
printenv
usage: printenv [-0] [env_var...]
printf
usage: printf FORMAT [ARGUMENT...]
prlimit
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).
ps
usage: ps [-AadefLlnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]
List processes.
Output modifiers:
pwd
usage: pwd [-L|-P]
pwdx
usage: pwdx PID...
readahead
usage: readahead FILE...
readlink
usage: readlink FILE
With no options, show what symlink points to, return error if not symlink.
realpath
usage: realpath FILE...
reboot
usage: reboot/halt/poweroff [-fn]
renice
usage: renice [-gpu] -n increment ID ...
reset
usage: reset
rev
usage: rev [FILE...]
Output each line reversed, when no files are given stdin is used.
rfkill
usage: rfkill COMMAND [DEVICE]
Commands:
list [DEVICE] List current state
block DEVICE Disable device
unblock DEVICE Enable device
rm
usage: rm [-fiRrv] FILE...
rmdir
usage: rmdir [-p] [dirname...]
-p Remove path
rmmod
usage: rmmod [-wf] [MODULE]
sed
usage: sed [-inrzE] [-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).
[ADDRESS[,ADDRESS]]COMMAND
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 delimiter 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:
D Delete one line of input and restart command SCRIPT (same as "d"
unless you've glued lines together with "N" or similar)
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)
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).
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.
seq
usage: seq [-w|-f fmt_str] [-s sep_str] [first] [increment] last
setfattr
usage: setfattr [-h] [-x|-n NAME] [-v VALUE] FILE...
setsid
usage: setsid [-t] command [args...]
sha1sum
usage: sha?sum [-bcs] [FILE]...
Calculate sha hash for each input file, reading from stdin if none. Output
one hash (40 hex digits for sha1, 56 for sha224, 64 for sha256, 96 for sha384,
and 128 for sha512) for each input file, followed by filename.
shred
usage: shred [-fuz] [-n COUNT] [-s SIZE] FILE...
Note: data journaling filesystems render this command useless, you must
overwrite all free space (fill up disk) to erase old data on those.
sleep
usage: sleep DURATION
sntp
usage: sntp [-saSdDqm] [-r SHIFT] [-m ADDRESS] [-p PORT] [SERVER]
Simple Network Time Protocol client. Query SERVER and display time.
sort
usage: sort [-Mbcdfginrsuz] [FILE...] [-k#[,#[x]] [-t X]] [-o FILE]
Sort all lines of text from input files (or stdin) to stdout.
-M Month sort (jan, feb, etc)
-V Version numbers (name-1.234-rc6.5b.tgz)
-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.
-k2.4,5 starts from the fourth character of the second word, to the end
of the fifth 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...).
stat
usage: stat [-tfL] [-c FORMAT] FILE...
strings
usage: strings [-fo] [-t oxd] [-n LEN] [FILE...]
-f Show filename
-n At least LEN characters form a string (default 4)
-o Show offset (ala -t d)
-t Show offset type (o=octal, d=decimal, x=hexadecimal)
su
usage: su [-lp] [-u UID] [-g GID,...] [-s SHELL] [-c CMD] [USER [COMMAND...]]
Switch user, prompting for password of new user when not run as root.
With one argument, switch to USER and run user's shell from /etc/passwd.
With no arguments, USER is root. If COMMAND line provided after USER,
exec() it as new USER (bypasing shell). If -u or -g specified, first
argument (if any) isn't USER (it's COMMAND).
swapoff
usage: swapoff swapregion
swapon
usage: swapon [-d] [-p priority] filename
switch_root
usage: switch_root [-c /dev/console] NEW_ROOT NEW_INIT...
sync
usage: sync
sysctl
usage: sysctl [-aAeNnqw] [-p [FILE] | KEY[=VALUE]...]
tac
usage: tac [FILE...]
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 [-cxt] [-fvohmjkOS] [-XTCf NAME] [FILES]
Options:
c Create x Extract t Test (list)
f tar FILE (default -) C Change to DIR first v Verbose display
o Ignore owner h Follow symlinks m Ignore mtime
J xz compression j bzip2 compression z gzip compression
O Extract to stdout X exclude names in FILE T include names in FILE
--exclude FILENAME to exclude --full-time show seconds with -tv
--mtime Use TIME for file timestamps --sparse Record sparse files
--owner Set file owner to NAME --group Set file group to NAME
--restrict All archive contents must extract under one subdirctory
--numeric-owner Save/use/display uid and gid, not user/group name
--no-recursion Don't store directory contents
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 existing 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.
tee
usage: tee [-ai] [file...]
-a Append to files
-i Ignore SIGINT
test
usage: test [-bcdefghLPrSsuwx PATH] [-nz STRING] [-t FD] [X ?? Y]
time
usage: time [-pv] 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.)
timeout
usage: timeout [-k DURATION] [-s SIGNAL] DURATION COMMAND...
top
usage: top [-Hbq] [-k FIELD,] [-o FIELD,] [-s SORT] [-n NUMBER] [-m LINES] [-d SECONDS] [-p PID,] [-u USER,]
-H Show threads
-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)
-O Add FIELDS (replacing PR,NI,VIRT,RES,SHR,S from default)
-s Sort by field number (1-X, default 9)
-b Batch mode (no tty)
-d Delay SECONDS between each cycle (default 3)
-m Maximum number of tasks to show
-n Exit after NUMBER iterations
-p Show these PIDs
-u Show these USERs
-q Quiet (no header lines)
touch
usage: touch [-amch] [-d DATE] [-t TIME] [-r FILE] FILE...
Update the access and modification times of each FILE to the current time.
true
Return zero.
truncate
usage: truncate [-c] -s SIZE file...
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]
tunctl
usage: tunctl [-dtT] [-u USER] NAME
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).
umount
usage: umount [-a [-t TYPE[,TYPE...]]] [-vrfD] [DIR...]
uname
usage: uname [-asnrvm]
-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]]
unix2dos
usage: unix2dos [FILE...]
unlink
usage: unlink FILE
uptime
usage: uptime [-ps]
Tell the current time, how long the system has been running, the number
of users, and the system load averages for the past 1, 5 and 15 minutes.
usleep
usage: usleep MICROSECONDS
uuencode
usage: uuencode [-m] [file] encode-filename
-m Base64
uuidgen
usage: uuidgen
vconfig
usage: vconfig COMMAND [OPTIONS]
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.
w
usage: w
Show who is logged on and since how long they logged in.
watch
usage: watch [-teb] [-n SEC] PROG ARGS
wc
usage: wc -lwcm [FILE...]
-l Show lines
-w Show words
-c Show bytes
-m Show characters
who
usage: who
whoami
usage: logname
xargs
usage: xargs [-0prt] [-s NUM] [-n 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.
xxd
usage: xxd [-c n] [-g n] [-i] [-l n] [-o n] [-p] [-r] [-s n] [file]
yes
usage: yes [args...]
zcat
usage: zcat [FILE...]