Measure Linux Manhood using Busybox

written
For 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 adb commands to get things to the right location on the device. When I was really stuck, I’d end up using adb shell and 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.

Busybox Test

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.

  1. acpid – ?
  2. addgroup – add a group by ID or name to a user
  3. adduser – add a user to the system
  4. adjtimex – adjust time?
  5. ar – ? archive?
  6. arp – related to networking, but I have no idea
  7. arping – ?
  8. ash – huh?
  9. awk – stream parsing? I’ve never used it but often hear it mentioned with sed
  10. basename – ?
  11. beep – make a beep, I’ve always used echo -e '\07'
  12. blkid – ?
  13. brctl – ?
  14. bunzip2 – decompress bz2 archive files
  15. bzcat – send to stdout the decompressed contents of a bz2 archive
  16. bzip2 – compress a file using bz2 format
  17. cal – show the calendar
  18. cat – send to stdout the contents of a file
  19. catv – related to cat?
  20. chat – you can do this?!?
  21. chattr – ? change file attributes ?
  22. chgrp – similar to chown, but only affect the group portion?
  23. chmod – change file permissions
  24. chown – change the owner of a file. can change user or group ownership.
  25. chpasswd – never used, but guessing it would change a password. I think passwd does the same thing.
  26. chpst – ?
  27. chroot – change where “/” is located in the file system. never used. Might be good for sandboxing guest users?
  28. chrt – abbreviation for chroot?
  29. chvt – ?
  30. cksum – generate a statistically unique number based on the contents of the stdin or a file.
  31. clear – clear the terminal screen
  32. cmp – ? compare?
  33. comm – ?
  34. cp – copy a file
  35. cpio – ? copy a stream or more low level copy ?
  36. crond – a daemon to run programs according to a schedule
  37. crontab – manage a cron schedule
  38. cryptpw – ?
  39. cut – split stdin or a file into an array
  40. date – output system time. can send it format args
  41. dc – ? direct copy? I think I’ve run into this during disk formatting.
  42. dd – ? direct device copy? used in conjunction with dc?
  43. deallocvt – ?
  44. delgroup – remove a group from a user
  45. deluser – remove a user
  46. depmod – ?
  47. devmem – ?
  48. df – device fullness. (my own way to remember it). Display current disk usage.
  49. dhcprelay – ? something related to dhcp
  50. diff – show the difference of 2 files
  51. dirname – never used it, I think pwd is more common
  52. dmesg – ?
  53. dnsd – DNS daemon
  54. dnsdomainname – ?
  55. dos2unix – change the line delimiters of a file to/from DOS style \r\n to UNIX \n
  56. dpkg – Debian program packaging utility
  57. du – Disk Usage. How much space is the current directory using on disk.
  58. dumpkmap – ?
  59. dumpleases – ?
  60. echo – print to stdout
  61. ed – old school line editor. I’m not old enough. Never used it.
  62. egrep – extended grep which allows for more advanced regular expressions
  63. eject – ? remove a floppy or CD ?
  64. env – ?
  65. envdir – ?
  66. envuidgid – ?
  67. expand – ?
  68. expr – ?
  69. fakeidentd – ?
  70. false – not true? used in scripting ?
  71. fbset – ?
  72. fbsplash – ?
  73. fdflush – ?
  74. fdformat – ?
  75. fdisk – ?
  76. fgrep – related to grep? what the “f”?
  77. find – find files based on various attributes
  78. findfs – ? Like find is some way?
  79. flash_lock – ?
  80. flash_unlock – ?
  81. fold – ? Laundry?
  82. free – ? Disk or memory?
  83. freeramdisk – ?
  84. fsck – file system checker
  85. fsck.minix – ?
  86. fsync – ?
  87. ftpd – FTP daemon
  88. ftpget – get file from FTP server
  89. ftpput – put a file onto an FTP server
  90. fuser – ?
  91. getopt – ? Helper for writing scripts?
  92. getty – ?
  93. grep – find text in a file or stdin
  94. gunzip – decompress a gz archive
  95. gzip – compress a file into a gz archive
  96. hd – ?
  97. hdparm – ? get parameters from hard drive?
  98. head – output to N number of lines from a file or stdin
  99. hexdump – ? Dump contents as hex characters
  100. hostid – ?
  101. hostname – hostname of the machine, and set it using the same command
  102. httpd – webserver daemon, I wonder it is Apache
  103. hush – ?
  104. hwclock – ? Hardware clock?
  105. id – ?
  106. ifconfig – manage network interfaces
  107. ifdown – turn off a network interface
  108. ifenslave – ?
  109. ifplugd – ?
  110. ifup – turn on a network interface
  111. inetd – ? I should know this, but I don’t
  112. init – ?
  113. inotifyd – ?
  114. insmod – ?
  115. install – ? Install what and where?
  116. ionice – ?
  117. ip – ? Related to networking…
  118. ipaddr – ?
  119. ipcalc – ?
  120. ipcrm – ?
  121. ipcs – ?
  122. iplink – ?
  123. iproute – ?
  124. iprule – ?
  125. iptunnel – ?
  126. kbd_mode – ? Keyboard mode?
  127. kill – kill a running process
  128. killall – kill all processes matching a criteria
  129. killall5 – ?
  130. klogd – ?
  131. last – ? like tail?
  132. length – ?
  133. less – file viewer with VI style navigation
  134. linux32 – ?
  135. linux64 – ?
  136. linuxrc – ?
  137. ln – link a file to another location
  138. loadfont – ?
  139. loadkmap – ?
  140. logger – ?
  141. login – login as another user
  142. logname – ?
  143. logread – ?
  144. losetup – ?
  145. lpd – ?
  146. lpq – ?
  147. lpr – ?
  148. ls – list files to stdout
  149. lsattr –?
  150. lsmod – ?
  151. lzmacat – ?
  152. lzop – ?
  153. lzopcat – ?
  154. makemime – ?
  155. man – view manual of a command. man busybox
  156. md5sum – like cksum but more commonly used
  157. mdev – ?
  158. mesg – ?
  159. microcom – ?
  160. mkdir – make a directory
  161. mkdosfs – ? make DOS file system?
  162. mkfifo – ?
  163. mkfs.minix – ?
  164. mkfs.vfat – ?
  165. mknod – ?
  166. mkpasswd – ?
  167. mkswap – ?
  168. mktemp – ?
  169. modprobe – ?
  170. more – predecessor to less and has fewer features. Many systems link more to less
  171. mount – mount a device to file system path
  172. mountpoint – ?
  173. mt – ?
  174. mv – move file to another path
  175. nameif – ?
  176. nc – ?
  177. netstat – get network statistics
  178. nice – change CPU priority of a process
  179. nmeter – ?
  180. nohup – run process detatched from current shell and as system root process
  181. nslookup – lookup IP address of DNS name
  182. od – ?
  183. openvt – ?
  184. passwd – change password
  185. patch – apply difference file generated by diff
  186. pgrep – ? What the ‘p’?
  187. pidof – ?
  188. ping – check for existence of another IP
  189. ping6 – same as ping but for IPv6
  190. pipe_progress – ? sounds interesting
  191. pivot_root –?
  192. pkill – kill all processes named X
  193. popmaildir – ? related to POP mail
  194. printenv – ?
  195. printf – ?
  196. ps – process list, list all currently running processes
  197. pscan – ?
  198. pwd – current working directory
  199. raidautorun – ?
  200. rdate – ?
  201. rdev – ?
  202. readlink – ?
  203. readprofile – ?
  204. realpath – ?
  205. reformime – ?
  206. renice – ?
  207. reset – ?
  208. resize – ?
  209. rm – remove file
  210. rmdir – remove directory
  211. rmmod –?
  212. route – ? related to networking
  213. rpm – Redhat package manager?
  214. rpm2cpio – ?
  215. rtcwake – ?
  216. run-parts – ?
  217. runlevel – ?
  218. runsv – ?
  219. runsvdir – ?
  220. rx – ? Prescription Drugs? How convienant
  221. script – ?
  222. scriptreplay – ?
  223. sed – stream editor
  224. sendmail – ? related to email
  225. seq – ?
  226. setarch – ?
  227. setconsole – ?
  228. setfont – ?
  229. setkeycodes – ?
  230. setlogcons – ?
  231. setsid – ?
  232. setuidgid – ?
  233. sh – start a new shell
  234. sha1sum – check sum generator like cksum and md5sum but considered more random. This is the 128 bits version.
  235. sha256sum – same as above but more bits
  236. sha512sum – even more bits
  237. showkey – ?
  238. slattach – ?
  239. sleep – suspend computer
  240. softlimit – ?
  241. sort – sort contents of stdin or file. Output to stdout
  242. split – ? I can guess, but didn’t know this existed.
  243. start-stop-daemon – ?
  244. stat – ?
  245. strings – ?
  246. stty – ?
  247. su – switch user
  248. sulogin – ?
  249. sum – ?
  250. sv – ?
  251. svlogd – ?
  252. swapoff – ?
  253. swapon – ?
  254. switch_root – ?
  255. sync – ?
  256. sysctl – ? Sounds familar
  257. syslogd – logging daemon
  258. tac – opposite of cat, will print in reverse order
  259. tail – output end of a file or steam
  260. tar – create an archive of one or more files
  261. taskset – ?
  262. tcpsvd – ?
  263. tee – write stdout to a file and still output to screen
  264. telnet – client to connect to another machine/hosts
  265. telnetd – telnet daemon to allow connections from other hosts
  266. test – ?
  267. tftp – ? What is the ’t’?
  268. tftpd – ? FTP server daemon. What is the ’t’?
  269. time – time how long a program takes to run. I often type this instead of date wanting to know what time it is on the server, and I’m always disappointed by the 0 result
  270. timeout – ? sounds interesting
  271. top – nice UI of top processes
  272. touch – change to modified timestamp of a file to now. Will create an empty file it doesn’t exist
  273. tr – ?
  274. traceroute – check how many network hops the current host is from another host
  275. true – ?
  276. tty – ?
  277. ttysize – ?
  278. udhcpc – ?
  279. udhcpd – ?
  280. udpsvd – ?
  281. umount – unmount a device from file system
  282. uname – output info about current OS installation
  283. uncompress – ? decompress a file, never used before
  284. unexpand – ? Ditto
  285. uniq – outputs unique occurrences of a line from a file or stdout. Input must already be sorted.
  286. unix2dos – opposite of dos2unix
  287. unlzma – ?
  288. unlzop – ?
  289. unzip – decompress a zip archive
  290. uptime – ?
  291. usleep – ?
  292. uudecode – ? What is UU?
  293. uuencode – ?
  294. vconfig – ?
  295. vi – visual editor
  296. vlock – ?
  297. volname – ?
  298. watch – continuously run a program and output the results watching for differences
  299. watchdog –?
  300. wc – word count, outputs lines then words then character count
  301. wget – pull a HTTP resource into file or stdout
  302. which – output the full path of a program
  303. who – who else is logged into current host
  304. whoami – which user I is my session
  305. xargs – ? I’be always wanted to learn this one…
  306. yes – output ‘y’ to stdin. Useful for automatically confirmation of install prompts
  307. zcatcat the contents of a gz archive
  308. zcip – ?

Conclusion

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.