Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Appendix C. BusyBox Commands

Appendix C. BusyBox Commands

BusyBox has many useful commands. Table C-1 lists the commands documented in a recent BusyBox snapshot.

Table C-1. Documented BusyBox Commands
CommandDescription
adduserAdd a user
adjtimexRead and optionally set system timebase parameters
arExtract or list FILES from an ar archive
arpManipulate the ARP cache
arpingSend ARP requests/replies
ashSmall shell, usually the default
basenameStrip directory path and suffixes from FILE
bbconfigPrint the config file that built BusyBox
bbshThe bbsh shell (command interpreter)
blkidPrint UUIDs of all filesystems
brctlManage Ethernet bridges
bunzip2Uncompress FILE
busyboxHello world!
bzcatUncompress to stdout
bzip2Compress FILE(s) with bzip2 algorithm
calDisplay a calendar
catConcatenate FILE(s) and print them to stdout
catvDisplay nonprinting characters as ^x or M\-x
chatUseful for interacting with a modem connected to stdin/stdout
chattrChange file attributes on an ext2 fs
chconChange the security context of each FILE to CONTEXT
chgrpChange the group membership of each FILE to GROUP
chmodChange permissions on a file
chownChange the owner and/or group of each FILE to OWNER and/or GROUP
chpasswdRead user:password information from stdin and update /etc/passwd accordingly
chpstChange the process state and run PROG
chrootRun COMMAND with root directory set to NEWROOT
chrtManipulate real-time attributes of a process
chvtChange the foreground virtual terminal to /dev/ttyN
cksumCalculate the CRC32 checksums of FILES
clearClear screen
cmpCompare FILE1 to stdin if FILE2 is not specified
commCompare FILE1 to FILE2, or to stdin if - is specified
cpCopy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY
cpioExtract or list files from a cpio archive, or create a cpio archive
crondDaemon to execute scheduled commands
crontabMaintain crontab files for individual users
cryptpwOutput a crypted string
cttyhackPrint selected fields from each input FILE to standard output
dateDisplay time (using +FMT) or set time
dcTiny RPN calculator
ddCopy a file with converting and formatting
deallocvtDeallocate unused virtual terminal /dev/ttyN
delgroupDelete group GROUP from the system or user USER from group GROUP
deluserDelete USER from the system
depmodManage devfs permissions and old device name symlinks
devmemRead/write from a physical address
dfPrint filesystem usage statistics
dhcprelayRelay DHCP requests from client devices to server device
diffCompare files line by line and output the differences
dirnameStrip a nondirectory suffix from FILENAME
dmesgPrint or control the kernel ring buffer
dnsdSmall static DNS server daemon
dos2unixConvert FILE from DOS to UNIX format
dpkgInstall, remove, and manage Debian packages
dpkg-debPerform actions on Debian packages (.debs)
duSummarize disk space used for each FILE and/or directory
dumpkmapPrint a binary keyboard translation table to standard output
dumpleasesDisplay DHCP leases granted by udhcpd
e2fsckCheck ext2/ext3 filesystem
echoPrint the specified ARGs to stdout
edEject the specified DEVICE (or default /dev/cdrom)
envPrint the current environment or run a program after setting
envdirSet various environment variables as specified by files
envuidgidSet $UID to account’s UID and $GID to account’s GID and run PROG
ether-wakeSend a magic packet to wake up sleeping machines
expandConvert tabs to spaces, writing to standard output
exprPrint the value of EXPRESSION to standard output
fakeidentdProvide fake ident (auth) service
FALSEReturn an exit code of FALSE (1)
fbsetShow and modify frame buffer settings
fbsplashSplash image
fdflushForce floppy disk drive to detect disk change
fdformatFormat floppy disk
fdiskChange partition table
fgrepSearch for files
findfsFind a filesystem device based on a label or UUID
foldWrap input lines in each FILE (standard input by default)
freeDisplay the amount of free and used system memory
freeramdiskFree all memory used by the specified ramdisk
fsckCheck and repair filesystems
fsck.minixCheck MINIX filesystem
ftpgetRetrieve a remote file via FTP
ftpputStore a local file on a remote machine via FTP
fuserFind processes that use FILEs or PORTs
getenforceParse command options
getseboolGet SELinux boolean value(s)
gettyOpen a tty, prompt for a login name, and then invoke /bin/login
grepSearch for PATTERN in each FILE or standard input
gunzipUncompress FILEs (or standard input)
gzipCompress FILEs (or standard input)
haltHalt the system
hdhd is an alias for hexdump
hdparmGet/set hd device parameters
headPrint first ten lines of each FILE to standard output
hexdumpDisplay file(s) or standard input in a user-specified format
hostidPrint a unique 32-bit identifier for the machine
hostnameGet or set hostname or DNS domain name
httpdListen for incoming HTTP requests
hushQuery and set hardware clock (RTC)
idPrint information about USER or the current user
ifconfigConfigure a network interface
ifdownTake down a network interface
ifenslaveConfigure network interfaces for parallel routing
ifupBring up a network interface
inetdListen for network connections and launch programs
initinit is the parent of all processes
inotifydSpawn user space agent on filesystem changes
insmodLoad the specified kernel modules into the kernel
installCopy files and set attributes
ipShow/manipulate routing, devices, policy routing, and tunnels
ipaddripaddr {add | delete} IFADDR dev STRING
ipcalcCalculate IP network settings from an IP address
ipcrmUppercase options MQS remove an object by shmkey value
ipcsProvide information on ipc facilities
iplinkiplink set DEVICE { up | down | arp | multicast { on | off }
iprouteiproute { list | flush } SELECTOR
ipruleiprule [list | add | del] SELECTOR ACTION
iptunneliptunnel { add | change | del | show } [NAME]
kbd_modeReport or set the keyboard mode
killSend a signal (default is TERM) to given PIDs
killallSend a signal (default is TERM) to given processes
killall5Send a signal (default is TERM) to all processes outside the current session
klogdKernel logger
lashlash is deprecated, so use hush
lastShow a listing of the last users who logged in to the system
lengthPrint STRING’s length
lessView a file or list of files
linux32Create a link named LINK_NAME or DIRECTORY to the specified TARGET
load_policyLoad a console font from standard input
loadkmapLoad a binary keyboard translation table from standard input
loggerWrite MESSAGE to the system log
loginBegin a new session on the system
lognamePrint the name of the current user
logreadShow messages in syslogd’s circular buffer
losetupSet up and control loop devices
lpdSPOOLDIR must contain (symlinks to) device nodes or directories
lpqLine printer daemon
lprLine printer remote
lsList directory contents
lsattrList file attributes on an ext2 fs
lsmodList the currently loaded kernel modules
lzmacatUncompress to stdout
makedevsCreate a range of special files as specified in a device table
makemimeCreate MIME-encoded message
manFormat and display a manual page
matchpathconGet the default SELinux security context
md5sumPrint or check MD5 checksums
mdevMini-udev implementation
mesgControl write access to your terminal
microcomCopy bytes for stdin to TTY and from TTY to stdout
mkdirCreate DIRECTORY
mke2fsCreate an ext2/ext3 filesystem
mkfifoCreate a named pipe (identical to mknod name p)
mkfs.minixMake a MINIX filesystem
mknodCreate a special file (block, character, or pipe)
mkswapPrepare a block device to be used as a swap partition
mktempCreate a temporary file
modprobeAdd or remove modules to or from the Linux kernel
moreView FILE or standard input one screen at a time
mountMount a filesystem
mountpointCheck if the directory is a mountpoint
mshControl magnetic tape drive operation
mvRename SOURCE to DEST, or move SOURCE(s) to DIRECTORY
nameifRename the network interface while it’s in the down state
ncTCP/IP Swiss army knife
netstatDisplay networking information
niceRun a program with a modified scheduling priority
nmeterMonitor the system in real time
nohupRun a command immune to hangups, with output to a non-tty
nslookupQuery the nameserver for the IP address of the given HOST
odWrite an unambiguous representation of FILE
openvtStart COMMAND on a new virtual terminal
parseParse tokens
passwdChange the user’s password
patchApply a diff file to an original
pgrepDisplay process(es) selected by the regex pattern
pidofList PIDs of all processes with names that match NAMEs
pingSend ICMP ECHO_REQUEST packets to network hosts
ping6Send ICMP ECHO_REQUEST packets to network hosts
pipe_progressMove the current root filesystem to PUT_OLD and make NEW_ROOT
pkillSend a signal to process(es) selected by the regex pattern
popmaildirFetch content of the remote mailbox to local maildir
poweroffHalt and shut off power
printenvPrint all or part of the environment
printfFormat and print ARGUMENT(s) according to FORMAT
psReport process status
pscanScan a host and print all open ports
pwdPrint the full filename of the current working directory
raidautorunTell the kernel to automatically search and start RAID arrays
rdateGet and possibly set the system date and time from a remote HOST
rdevPrint the device node associated with the filesystem mounted at /
readaheadPreload FILE(s) in RAM cache so that subsequent reads for those files do not block on disk I/O
readlinkDisplay the value of a symlink
readprofileRead kernel profiling information
realpathReturn the absolute pathnames of a given argument
rebootReboot the system
reformimeParse a MIME-encoded message
reniceChange the priority of running processes
resetReset the screen
resizeResize the screen
restoreconReset security contexts of files in the pathname
rmRemove (unlink) files
rmdirRemove the DIRECTORY if it is empty
rmmodUnload the specified kernel modules from the kernel
routeEdit kernel routing tables
rpmManipulate RPM packages
rpm2cpioOutput a cpio archive of the rpm file
rtcwakeEnter a system sleep state until the specified wakeup time
run-partsRun a bunch of scripts in a directory
runconRun a program in a different security context
runlevelReport the previous and current runlevel
runsvStart and monitor a service and optionally an appendant log service
runsvdirStart a runsv process for each subdirectory. If it exits, restart it.
rxReceive a file using the xmodem protocol
scriptMake a typescript of a terminal session
sedStream editor for filtering and transforming text
selinuxenabledDetermine if SELinux is enabled
seqPrint numbers from FIRST to LAST, in steps of INCREMENT
sestatusSELinux status tool
setarchChange the reported architecture
setconsoleRedirect system console output to DEVICE (default: /dev/tty)
setenforceReset file contexts under pathname according to spec_file
setfontLoad a console font
setkeycodesSet entries into the kernel’s scancode-to-keycode map
setlogconsRedirect the kernel output to console N
setseboolChange SELinux boolean setting
setsidRun PROG in a new session
setuidgidSet uid and gid to account’s uid and gid
shPrint or check SHA1 checksums
showkeyShow keys pressed
slattachAttach network interface(s) to serial line(s)
sleepDelay for a specified amount of time
softlimitSet soft resource limits, and then run PROG
sortSort lines of text
splitSplit a file into pieces
start-stop-daemonStart and stop system daemon programs
statDisplay file (default) or filesystem status
stringsDisplay printable strings in a binary file
sttyChange and print terminal line settings
suChange user ID or become root
suloginSingle user login
sumChecksum and count the blocks in a file
svControl services monitored by runsv supervisor
svlogdRead log data from standard input, optionally filter log messages, and write the data to one or more automatically rotated logs
swapoffStop swapping on DEVICE
swaponStart swapping on DEVICE
switch_rootSwitch to another filesystem as the root of the mount tree
syncWrite all buffered filesystem blocks to disk
sysctlConfigure kernel parameters at runtime
syslogdSystem logging utility
tacConcatenate FILE(s) and print them in reverse
tailPrint last ten lines of each FILE to standard output
tarCreate, extract, or list files from a tar file
tasksetSet or get CPU affinity
tcShow/manipulate traffic control settings
tcpsvdCreate TCP socket, bind it to ip:port, and listen
teeCopy standard input to each FILE, and also to standard output
telnetConnect to telnet server
telnetdHandle incoming telnet connections
testCheck file types, compare values, and so on. Return a 0/1 exit code.
tftpTransfer a file from/to the TFTP server
tftpdTransfer a file on the TFTP client’s request
timeRun programs and summarize system resource usage
topProvide a view of process activity in real time
touchUpdate the last-modified date on the given FILE(s)
trTranslate, squeeze, and/or delete characters
tracerouteTrace the route to HOST
TRUEReturn an exit code of TRUE (0)
ttyPrint filename of standard input’s terminal
ttysizePrint dimension(s) of standard input’s terminal
tune2fsAdjust filesystem options on ext[23] filesystems
udhcpcVery small DHCP client
udhcpdVery small DHCP server
udpsvdCreate UDP socket, bind it to ip:port, and wait
umountUnmount filesystems
unamePrint system information
uncompressUncompress .Z file(s)
unexpandConvert spaces to tabs, writing to standard output
uniqDiscard duplicate lines
unix2dosConvert FILE from UNIX to DOS format
unlzmaUncompress FILE
unzipExtract files from ZIP archives
uptimeDisplay the time since the last boot
usleepPause for N microseconds
uudecodeUudecode a file
uuencodeUuencode a file to stdout
vconfigCreate and remove virtual Ethernet devices
viEdit a FILE
vlockLock a virtual terminal
watchExecute a program periodically
watchdogPeriodically write to watchdog device DEV
wcPrint line, word, and byte counts for each FILE
wgetRetrieve files via HTTP or FTP
whichLocate a COMMAND
whoShow who is logged on
whoamiPrint the username associated with the current effective user ID
xargsExecute COMMAND on every item given by standard input
yesOutput a string repeatedly until killed
zcatUncompress to stdout
zcipManage a ZeroConf IPv4 link-local address



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial