I'm using busybox in a embedded system, and I would like to check its version. How do I check the busybox version from within busybox?
Invoke the busybox binary as
busybox, and you get a line with the Busybox version, a few more lines of fluff, and the list of utilities included in the binary.
busybox | head -1
Most utilities show a usage message if you call them with
--help, with the version number in the first line.
ls --help 2>&1 | head -1
You can check the version on any system running busybox by running any of the commands with the
--help flag to see usage. The first line of the usage calls includes a note about the busybox version:
$ cat --help BusyBox v1.18.4 (2011-03-13 15:36:03 CET) multi-call binary. Usage: cat [FILE]... Concatenate FILEs and print them to stdout
If you are not running busybox but have it installed on your system, you can check by instantiating one of the utilities like so:
$ busybox cat --help
(Edit: As Gilles notes you can also call the busybox binary without a command and get the same header)
Lastly, there is also a note at the end of the man page that shows what version it's from:
$ man busybox | tail -n 1 version 1.18.4 2011-03-13 BUSYBOX(1)
Does it not report the version when you connect,
telnet 10.10.10.1 BusyBox v0.61.pre (2008.06.11-10:37+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands. #
or run (for example)
# busybox ash BusyBox v1.17.1 (Debian 1:1.17.1-8) built-in shell (ash) Enter 'help' for a list of built-in commands. #
Another way to check the busybox version is to look at the raw program file and only display lines that have BusyBox in them
strings $(which busybox) | grep \\\<BusyBox or strings /bin/busybox | grep 'BusyBox'
this one also works, it works by looking for a " v" that has a "." after it without a space character between the "v" and the "."
strings /bin/busybox | grep '[ ][v][^ ]*[.]'
I see output that looks like
syslogd started: BusyBox v1.32.0 BusyBox v1.32.0 (2020-11-03 15:21:44 +03)