Considering some routers have 16 megs or less of ram, and not much more flash, smaller is better. It is for this same reason why we have tools like busybox, which is a single executable around a meg in size that essentially replaces GNU coreutils.
Also, it is almost always statically linked, meaning you can do all of this without hitting the FS to fetch libraries. That's a huge plus if you're in a tightly constrained environment. Most importantly, it's its own shell: You can run it as a shell (ash) and access all the built-in commands interactively. It's so useful in this regard that Debian includes it in initrd, so if the system is so hosed up that it can't mount its own filesystems, you still have a high quality rescue shell—and some hope.
Just in case somebody else does not know what busybox is.
BusyBox: The Swiss Army Knife of Embedded Linux
BusyBox combines tiny versions of many common UNIX utilities into a single small executable. <..>
If you install busy box on it you'll get the majority of the common commands. Usually requires root. Basically it will give you one binary and a bunch of symlinks. Busy box will act like the command at the end of the link if it's capable. In some cases I've had to create symlinks on the android device because the installer didn't create the one I needed.
Here's a list of available commands: http://www.busybox.net/downloads/BusyBox.html
If you're looking to do specific things with Android, look at the SDK: http://developer.android.com/sdk/index.html
Android is significantly different than a general Linux distribution as Android is Linux + Android where Linux distributions are Linux + GNU (or GNU + Linux if you prefer). You cannot use normal Linux binaries, without recompiling them for Android.
> 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 some device nodes in /dev, a few configuration files in /etc, and a Linux kernel.
BusyBox just a single executable file. The commands it provides are based on how you call the program or by what the symlink is named.
From their website (http://www.busybox.net/FAQ.html#whatis):
tl;dr you get commands from a full GNU/Linux setup on an embedded Linux platform
Linux kernel contributors haven't been trying to enforce the GPL as Busybox has been doing. In fact, it's the first point on http://www.busybox.net/. It hasn't done wonders for adoption of Busybox. It was more popular in the past before Android led the way in making a poor quality (but usable) alternative for it, which has now been replaced by a high quality alternative (Toybox). Tizen and OpenEmbedded (Yocto Project) also moved to Toybox and other embedded vendors will be replacing either Busybox or their own tools with it. Toybox is still very new, but lower quality alternatives existed before it and vendors were driven to them. It's not very logical since the Linux kernel is also GPL2, sure.
Now you're just talking out of your ass. Busybox is GPL version 2, just like Linux.
edit: Since /u/px403 deleted his comment - He claimed Busybox was GPLv3 and as a result, it was wiping out linux development groups among other FUD.
The initramfs which holds the extracted initcpio (which the boot loader is passing to the kernel) usually contains a whole mini Linux system (often based on BusyBox so that there aren't many space-wasting binaries) so that stuff like Udev (which enumerates devices, loads modules and creates device nodes under /dev
) can run. A minimalistic shell is a part of that and even an important one because the initramfs boot program /init
is nearly always a shell script.
So this script bails out and gives you a shell to manually carry on. If you manage to find the correct root partition, mount it (there is usually a directory /new_root
or so for this purpose) and invoke <code>switch_root</code>, you can still boot the system.
When I first read that story, I compiled a staticly linked version of Busybox which I keep in my home directory, just in case. (Busybox combines tiny versions of many common UNIX utilities into a single small executable; it's used on embedded systems)
It can save your life (figuratively). Set up a uclibc toolchain (GNU libc doesn't like being statically linked) or use buildroot or however they do it these days, and build one for yourself.
The one matching your CPU instruction set (AIDA64 will tell you) from http://www.busybox.net/downloads/binaries/latest/
For what it does. Nothing in itself. It's a collection of tools. /u/RickRussellTX explained it well. Basically an app will tell you if it needs busybox.
I'm looking for a version of this. There are apps in the Play Store that install it for you, but obviously that won't be available on iOS.
I've been using Saurik and iNinjas repos for stuff, but I can't find the "iw" command and I'm sure there will be more stuff that I won't be able to get that I could if I had BusyBox.
Busybox with 347 commands-
sudo mkdir -p /opt/bin && sudo curl http://www.busybox.net/downloads/binaries/latest/busybox-x86_64 -o /opt/bin/busybox && sudo chmod 4555 /opt/bin/busybox
Nano -
docker run -d --name nano base/archlinux:latest sleep && sudo docker cp nano:/usr/bin/nano /opt/bin && docker rm nano
Vi is an alias to Vim.
Could that be translated in English to a "Swiss army knife"? (Swiss-German "Sackmesser" / German "Schweizer Offiziersmesser")
It's more specific to a collection of tools than as a general phrase. For example, a collection of minimal utilities for Embedded Linux (BusyBox) calls itself "The Swiss Army Knife of Embedded Linux".
Here's one that's not getting mentioned: busybox. It's a bit redundant on your own fully "GNU/Linux" boxen, as opposed to Android/Linux or other people's systems where you don't have control over what software is or isn't installed, but can be really useful on any system that doesn't have a full complement of "full" versions of coreutils and other basic utilities.
(Also, just looking at the BusyBox command help page is practically a "list of useful terminal-based applications" all by itself...)
If you have busybox (CM already has this), there are several useful commands.
Shows detailed list of running processes and specific memory/CPU usage # busybox top
Prints information about the CPU and its capabilities # cat /proc/cpuinfo
If you want to manually kill a process with deadly force, you can do this. Let's say Angry Birds was acting up. # pgrep rovio 5818 (this is the PID, it can be anything) # kill -9 5818
I mean, you shouldn't ever really have to use that.
This will show you all internet current connections that your device has. # netstat -l
This shows you basic info about the OS you're running $ uname -a
This will perform a backtrace. $ traceroute <HOST, e.g google.com>
This is the worst text editor that was ever made for Unix. (To the guys I just pissed off: I'm sorry, but I just don't get this thing, nano is so much more efficient.) $ vi
Yeah, there's some basic stuff you can do with your terminal. Take a look at this for more core commands