Measure Linux Manhood using BusyboxFor those in the embedded Linux world, Busybox seems to be the single most important thing to have in their filesystem other than OS itself. This is something I just recently discovered as I started rooting my Android devices. Prior to Busybox I’ve been stuck using my laptop to edit files, then using
adbcommands to get things to the right location on the device. When I was really stuck, I’d end up using
adb shelland the simplified utilities that are in
/system/bin. But now with Busybox I have access to all the commands I’m accustom to using in a full Linux/Unix distribution.
What is Busybox, exactly? According to their documentation, “BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU coreutils, util-linux, etc.”
For years I’ve been too lazy or intimidated by Linux and its super huge list of programs that I’ve never really spent the time to figure out which utils I should really know and which are just gravy. For instance if I use Ubuntu’s package manager to install a program, I’m bombarded with tens of thousands of possibilities. ~38,500 according to this answer. Who has time to evaluate all those programs?!?
Test of Man/Womanhood
So where am I going with all this? What about the Test of Manhood? If Busybox is so great and contains commonly used functions, then I assert that one of a Linux Adminsâ€™ job interview questions should be, “Give a short description of each one of these commands and when you would use it.” Then toss the Busybox command/applet list across the table and stare intensely at the candidate.
I am not a Linux expert, but I can get a system running in a pinch. My rough guess is I have fluency in only 10% of the Busybox commands, and the rest I have to Google or take by blind faith when I use some online shell snippet. I want to put that 10% to the test. I’m going to answer my own interview question, and you’ll just need to trust me that I’m not using the Busybox manual during the test. Actually, I have no reason to cheat since I’m really doing this to see how much I don’t know, and as a benchmark for how I can improve in the future.
addgroup– add a group by ID or name to a user
adduser– add a user to the system
adjtimex– adjust time?
ar– ? archive?
arp– related to networking, but I have no idea
awk– stream parsing? I’ve never used it but often hear it mentioned with
beep– make a beep, I’ve always used
echo -e '\07'
bunzip2– decompress bz2 archive files
bzcat– send to stdout the decompressed contents of a bz2 archive
bzip2– compress a file using bz2 format
cal– show the calendar
cat– send to stdout the contents of a file
catv– related to cat?
chat– you can do this?!?
chattr– ? change file attributes ?
chgrp– similar to chown, but only affect the group portion?
chmod– change file permissions
chown– change the owner of a file. can change user or group ownership.
chpasswd– never used, but guessing it would change a password. I think
passwddoes the same thing.
chroot– change where “/” is located in the file system. never used. Might be good for sandboxing guest users?
chrt– abbreviation for
cksum– generate a statistically unique number based on the contents of the stdin or a file.
clear– clear the terminal screen
cmp– ? compare?
cp– copy a file
cpio– ? copy a stream or more low level copy ?
crond– a daemon to run programs according to a schedule
crontab– manage a cron schedule
cut– split stdin or a file into an array
date– output system time. can send it format args
dc– ? direct copy? I think I’ve run into this during disk formatting.
dd– ? direct device copy? used in conjunction with
delgroup– remove a group from a user
deluser– remove a user
df– device fullness. (my own way to remember it). Display current disk usage.
dhcprelay– ? something related to dhcp
diff– show the difference of 2 files
dirname– never used it, I think
pwdis more common
dnsd– DNS daemon
dos2unix– change the line delimiters of a file to/from DOS style
dpkg– Debian program packaging utility
du– Disk Usage. How much space is the current directory using on disk.
echo– print to stdout
ed– old school line editor. I’m not old enough. Never used it.
grepwhich allows for more advanced regular expressions
eject– ? remove a floppy or CD ?
false– not true? used in scripting ?
fgrep– related to grep? what the “f”?
find– find files based on various attributes
findfs– ? Like find is some way?
fold– ? Laundry?
free– ? Disk or memory?
fsck– file system checker
ftpd– FTP daemon
ftpget– get file from FTP server
ftpput– put a file onto an FTP server
getopt– ? Helper for writing scripts?
grep– find text in a file or stdin
gunzip– decompress a gz archive
gzip– compress a file into a gz archive
hdparm– ? get parameters from hard drive?
head– output to N number of lines from a file or stdin
hexdump– ? Dump contents as hex characters
hostname– hostname of the machine, and set it using the same command
httpd– webserver daemon, I wonder it is Apache
hwclock– ? Hardware clock?
ifconfig– manage network interfaces
ifdown– turn off a network interface
ifup– turn on a network interface
inetd– ? I should know this, but I don’t
install– ? Install what and where?
ip– ? Related to networking…
kbd_mode– ? Keyboard mode?
kill– kill a running process
killall– kill all processes matching a criteria
last– ? like tail?
less– file viewer with VI style navigation
ln– link a file to another location
login– login as another user
ls– list files to stdout
man– view manual of a command.
cksumbut more commonly used
mkdir– make a directory
mkdosfs– ? make DOS file system?
more– predecessor to
lessand has fewer features. Many systems link
mount– mount a device to file system path
mv– move file to another path
netstat– get network statistics
nice– change CPU priority of a process
nohup– run process detatched from current shell and as system root process
nslookup– lookup IP address of DNS name
passwd– change password
patch– apply difference file generated by
pgrep– ? What the ‘p’?
ping– check for existence of another IP
ping6– same as
pingbut for IPv6
pipe_progress– ? sounds interesting
pkill– kill all processes named X
popmaildir– ? related to POP mail
ps– process list, list all currently running processes
pwd– current working directory
rm– remove file
rmdir– remove directory
route– ? related to networking
rpm– Redhat package manager?
rx– ? Prescription Drugs? How convienant
sed– stream editor
sendmail– ? related to email
sh– start a new shell
sha1sum– check sum generator like
md5sumbut considered more random. This is the 128 bits version.
sha256sum– same as above but more bits
sha512sum– even more bits
sleep– suspend computer
sort– sort contents of stdin or file. Output to stdout
split– ? I can guess, but didn’t know this existed.
su– switch user
sysctl– ? Sounds familar
syslogd– logging daemon
tac– opposite of
cat, will print in reverse order
tail– output end of a file or steam
tar– create an archive of one or more files
tee– write stdout to a file and still output to screen
telnet– client to connect to another machine/hosts
telnetd– telnet daemon to allow connections from other hosts
tftp– ? What is the ’t’?
tftpd– ? FTP server daemon. What is the ’t’?
time– time how long a program takes to run. I often type this instead of
datewanting to know what time it is on the server, and I’m always disappointed by the 0 result
timeout– ? sounds interesting
top– nice UI of top processes
touch– change to modified timestamp of a file to now. Will create an empty file it doesn’t exist
traceroute– check how many network hops the current host is from another host
umount– unmount a device from file system
uname– output info about current OS installation
uncompress– ? decompress a file, never used before
unexpand– ? Ditto
uniq– outputs unique occurrences of a line from a file or stdout. Input must already be sorted.
unix2dos– opposite of
unzip– decompress a zip archive
uudecode– ? What is UU?
vi– visual editor
watch– continuously run a program and output the results watching for differences
wc– word count, outputs lines then words then character count
wget– pull a HTTP resource into file or stdout
which– output the full path of a program
who– who else is logged into current host
whoami– which user I is my session
xargs– ? I’be always wanted to learn this one…
yes– output ‘y’ to stdin. Useful for automatically confirmation of install prompts
catthe contents of a gz archive
Three hundred and eight commands later… I’m tired. And as you can see, I have a long way to go. 99 commands known, and 209 commands unknown. 33% is better than the predicted 10% Woohoo!
Now I have the task of reading the Busybox documentation more thoroughly to see what I’ve been missing my whole shell life.
So where do you stand on the Busybox challenge? Are the Busybox commands already at your mercy or is it this the missing Linux link? Post your percentage in the comments.