Busybox команды для линукс
BusyBox has been written with size-optimization and limited resources in mind. It is also extremely modular so you can easily include or exclude commands (or features) at compile time. This makes it easy to customize your embedded systems. To create a working system, just add a kernel, a shell (such as ash), and an editor (such as elvis-tiny or ae).
USAGE
For example, entering
will cause BusyBox to behave as ‘ls’ (if the ‘ls’ command has been compiled into BusyBox).
You can also invoke BusyBox by issuing the command as an argument on the command line. For example, entering
will also cause BusyBox to behave as ‘ls’.
COMMON OPTIONS
COMMANDS
adjtimex, ar, basename, busybox, cat, chgrp, chmod, chown, chroot, chvt, clear, cmp, cp, cpio, cut, date, dc, dd, deallocvt, df, dirname, dmesg, dos2unix, dpkg, dpkg-deb, du, dumpkmap, dutmp, echo, expr, false, fbset, fdflush, find, free, freeramdisk, fsck.minix, getopt, grep, gunzip, gzip, halt, head, hostid, hostname, id, ifconfig, init, insmod, kill, killall, klogd, length, ln, loadacm, loadfont, loadkmap, logger, logname, ls, lsmod, makedevs, md5sum, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp, more, mount, mt, mv, nc, nslookup, ping, pivot_root, poweroff, printf, ps, pwd, rdate, readlink, reboot, renice, reset, rm, rmdir, rmmod, route, rpm2cpio, sed, setkeycodes, sh, sleep, sort, stty, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet, test, tftp, touch, tr, true, tty, umount, uname, uniq, unix2dos, update, uptime, usleep, uudecode, uuencode, watchdog, wc, wget, which, whoami, xargs, yes, zcat, [
adjtimex adjtimex [ -q ] [ -o offset] [ -f frequency] [ -p timeconstant] [ -t tick]
Reads and optionally sets system timebase parameters. See adjtimex (2).
Extract or list FILES from an ar archive.
Strips directory path and suffixes from FILE . If specified, also removes any trailing SUFFIX .
Concatenates FILE (s) and prints them to stdout.
Change the group membership of each FILE to GROUP .
Each MODE is one or more of the letters ugoa, one of the symbols +-= and one or more of the letters rwxst.
Change the owner and/or group of each FILE to OWNER and/or GROUP .
Run COMMAND with root directory set to NEWROOT .
Changes the foreground virtual terminal to /dev/ttyN
Copies SOURCE to DEST , or multiple SOURCE (s) to DIRECTORY .
Extract or list files from a cpio archive Main operation mode:
Prints selected fields from each input FILE to standard output.
Displays the current time in the given FORMAT , or sets the system date.
This is a Tiny RPN calculator that understands the following operations: +, -, /, *, and, or, not, eor. i.e., ‘dc 2 2 add’ -> 4, and ‘dc 8 8 \* 2 2 + /’ -> 16
Copy a file, converting and formatting according to options
Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024), MD (x1000000), M (x1048576), GD (x1000000000) or G (x1073741824).
Deallocate unused virtual terminal /dev/ttyN
Print the filesystem space used and space available.
Strips non-directory suffix from FILENAME
Prints or controls the kernel ring buffer
Converts FILE from dos format to unix format. When no option is given, the input is converted to the opposite output format. When no file is given, uses stdin for input and stdout for output.
Perform actions on debian packages (.debs)
Summarizes disk space used for each FILE and/or directory. Disk space is printed in units of 1024 bytes.
Prints out a binary keyboard translation table to standard output.
Dump utmp file format (pipe delimited) from FILE or stdin to stdout. (i.e., ‘dutmp /var/run/utmp’)
Prints the specified ARGs to stdout
Prints the current environment or runs a program after setting up the specified environment.
Prints the value of EXPRESSION to standard output.
EXPRESSION may be:
Beware that many operators need to be escaped or quoted for shells. Comparisons are arithmetic if both ARGs are numbers, else lexicographical. Pattern matches return the string matched between \( and \) or null; if \( and \) are not used, they return the number of characters matched or 0.
Return an exit code of FALSE (1).
Show and modify frame buffer settings
Forces floppy disk drive to detect disk change
Search for files in a directory hierarchy. The default PATH is the current directory; default EXPRESSION is ‘ -print ‘
EXPRESSION may consist of:
Displays the amount of free and used system memory
Frees all memory used by the specified ramdisk.
Performs a consistency check for MINIX filesystems.
Parse command options
Search for PATTERN in each FILE or standard input.
Uncompress FILE (or standard input if FILE is ‘-‘).
Compress FILE with maximum compression. When FILE is ‘-‘, reads standard input. Implies -c .
Halt the system.
Print first 10 lines of each FILE to standard output. With more than one FILE , precede each with a header giving the file name. With no FILE , or when FILE is -, read standard input.
Print out a unique 32-bit identifier for the machine.
Get or set the hostname or DNS domain name. If a hostname is given (or FILE with the -F parameter), the host name will be set.
Print information for USERNAME or the current user
configure a network interface
Init is the parent of all processes.
This version of init is designed to be run only by the kernel.
BusyBox init doesn’t support multiple runlevels. The runlevels field of the /etc/inittab file is completely ignored by BusyBox init. If you want runlevels, use sysvinit.
BusyBox init works just fine without an inittab. If no inittab is found, it has the following default behavior:
if it detects that /dev/console is _not_ a serial console, it will also run:
If you choose to use an /etc/inittab file, the inittab entry format is as follows:
Example /etc/inittab file:
Loads the specified kernel modules into the kernel.
Send a signal (default is SIGTERM ) to the specified process(es).
——————————-
killall killall [ -signal ] process-name [process-name . ]
Send a signal (default is SIGTERM ) to the specified process(es).
Kernel logger. Options:
lash: The BusyBox LAme SHell (command interpreter)
This command does not yet have proper documentation.
Use lash just as you would use any other shell. It properly handles pipes, redirects, job control, can be used as the shell for scripts, and has a sufficient set of builtins to do what is needed. It does not (yet) support Bourne Shell syntax. If you need things like «if-then-else», «while», and such use ash or bash. If you just need a very simple and extremely small shell, this will do the job.
Prints out the length of the specified STRING .
——————————-
ln ln [ OPTION ] TARGET . LINK_NAME|DIRECTORY
Create a link named LINK_NAME or DIRECTORY to the specified TARGET
You may use ‘—‘ to indicate that all following arguments are non-options.
——————————-
loadacm loadacm loadfont loadfont loadkmap loadkmap logger logger [ OPTION ]. [ MESSAGE ]
Write MESSAGE to the system log. If MESSAGE is omitted, log stdin.
Print the name of the current user.
Shows the messages from syslogd (using circular buffer).
——————————-
ls ls [ -1AacCdeFilnpLRrSsTtuvwxXhk ] [filenames. ]
List directory contents
List the currently loaded kernel modules.
——————————-
makedevs makedevs NAME TYPE MAJOR MINOR FIRST LAST [s]
Creates a range of block or character special files
FIRST specifies the number appended to NAME to create the first device. LAST specifies the number of the last item that should be created. If ‘s’ is the last argument, the base device is created as well.
——————————-
md5sum md5sum [ OPTION ] [ FILE ]. or: md5sum [ OPTION ] -c [ FILE ]
Print or check MD5 checksums.
Options: With no FILE , or when FILE is -, read standard input.
The following two options are useful only when verifying checksums:
Create the DIRECTORY(ies) if they do not already exist
Creates a named pipe (identical to ‘mknod name p’)
——————————-
mkfs_minix mkfs_minix [ -c | -l filename] [ -nXX ] [ -iXX ] /dev/name [blocks]
Make a MINIX filesystem.
——————————-
mknod mknod [ OPTIONS ] NAME TYPE MAJOR MINOR
Create a special file (block, character, or pipe).
——————————-
mkswap mkswap [ -c ] [ -v0 | -v1 ] device [block-count]
Prepare a disk partition to be used as a swap partition.
Creates a temporary file with its name based on TEMPLATE . TEMPLATE is any name with six `Xs’ (i.e., /tmp/temp.XXXXXX).
Used for hight level module loading and unloading.
More is a filter for viewing FILE one screenful at a time.
——————————-
mount mount [flags] DEVICE NODE [ -o options,more-options]
Mount a filesystem
Options for use with the » -o » flag:
There are EVEN MORE flags that are specific to each filesystem. You’ll have to see the written documentation for those filesystems.
Control magnetic tape drive operation
bsf bsfm bsr bss datacompression drvbuffer eof eom erase fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2 ras3 reset retension rew rewoffline seek setblk setdensity setpart tell unload unlock weof wset
——————————-
mv mv SOURCE DEST or: mv SOURCE . DIRECTORY
Rename SOURCE to DEST , or move SOURCE (s) to DIRECTORY .
Netcat opens a pipe to IP :port
Queries the nameserver for the IP address of the given HOST optionally using a specified DNS server
Lists the PIDs of all processes with names that match the names on the command line
Send ICMP ECHO_REQUEST packets to network hosts.
Move the current root file system to PUT_OLD and make NEW_ROOT the new root file system.
Halt the system and request that the kernel shut off the power.
Formats and prints ARGUMENT (s) according to FORMAT , Where FORMAT controls the output exactly as in C printf.
Report process status
This version of ps accepts no options.
Print the full filename of the current working directory.
Get and possibly set the system date and time from a remote HOST .
Read a symbolic link.
Reboot the system.
Changes priority of running processes. Allowed priorities range from 20 (the process runs only when nothing else is running) to 0 (default priority) to -20 (almost nothing else ever gets to run).
Resets the screen.
Remove (unlink) the FILE (s). You may use ‘—‘ to indicate that all following arguments are non-options.
Remove the DIRECTORY(ies), if they are empty.
Unloads the specified kernel modules from the kernel.
Edit the kernel’s routing tables
Outputs a cpio archive of the rpm file.
If no -e or -f is given, the first non-option argument is taken as the sed script to interpret. All remaining arguments are names of input files; if no input files are specified, then the standard input is read.
Set entries into the kernel’s scancode-to-keycode map, allowing unusual keyboards to generate usable keycodes.
SCANCODE may be either xx or e0xx (hexadecimal), and KEYCODE is given in decimal
Pause for N seconds.
Sorts lines of text in the specified files
Without arguments, prints baud rate, line discipline, and deviations from stty sane.
Stop swapping virtual memory pages on DEVICE .
Start swapping virtual memory pages on DEVICE .
Write all buffered filesystem blocks to disk.
Linux system and kernel logging utility. Note that this version of syslogd ignores /etc/syslog.conf.
Print last 10 lines of each FILE to standard output. With more than one FILE , precede each with a header giving the file name. With no FILE , or when FILE is -, read standard input.
If the first character of N (bytes or lines) is a ‘+’, output begins with the Nth item from the start of each file, otherwise, print the last N items in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).
——————————-
tar tar -[cxtvO] [- -exclude FILE ] [ -X FILE ][ -f TARFILE ] [ -C DIR ] [ FILE (s)] .
Create, extract, or list files from a tar file.
Copy standard input to each FILE , and also to standard output.
Telnet is used to establish interactive communication with another computer over a network using the TELNET protocol.
Checks file types and compares values returning an exit code determined by the value of EXPRESSION .
Transfers a file from/to a tftp server using «octet» mode.
Update the last-modified date on the given FILE[s].
Translate, squeeze, and/or delete characters from standard input, writing to standard output.
——————————-
traceroute traceroute [ -dnrv ] [ -m max_ttl] [ -p port#] [ -q nqueries] [ -s src_addr] [ -t tos] [ -w wait] host [data size]
trace the route ip packets follow going to «host» Options:
Return an exit code of TRUE (0).
Print the file name of the terminal connected to standard input.
Unmount file systems
Print certain system information. With no OPTION , same as -s .
Discard all but one of successive identical lines from INPUT (or standard input), writing to OUTPUT (or standard output).
Converts FILE from unix format to dos format. When no option is given, the input is converted to the opposite output format. When no file is given, uses stdin for input and stdout for output. Options:
Periodically flushes filesystem buffers.
Display the time since the last boot.
Pause for N microseconds.
Uudecode a file that is uuencoded.
——————————-
uuencode uuencode [ OPTION ] [ INFILE ] REMOTEFILE
Uuencode a file.
Periodically write to watchdog device DEV
Print line, word, and byte counts for each FILE , and a total line if more than one FILE is specified. With no FILE , read standard input.
——————————-
wget wget [ -c |- -continue ] [ -q |- -quiet ] [ -O |- -output -document file] [- -header ‘header: value’] [ -P DIR ] url
wget retrieves files via HTTP or FTP
Locates a COMMAND .
Prints the user name associated with the current effective user id.
Executes COMMAND on every item given by standard input.
Repeatedly outputs a line with all specified STRING (s), or ‘y’.
Uncompress to stdout.
LIBC NSS
If you are using a system that is using a remote LDAP server for authentication via GNU libc NSS , and you want to use BusyBox, then you will need to adjust the BusyBox source. Chances are though, that if you have enough space to install of that stuff on your system, then you probably want the full GNU utilities.
Источник