BusyBox: Difference between revisions

From Alpine Linux
m (fixed heading names to follow Help:Style)
(moved content to Shell management and added link here)
Line 2: Line 2:


== Ash shell ==
== Ash shell ==
 
{{Main|Shell_management#Ash shell}}
Alpine Linux uses Busybox Ash for its default shell. To change the default shell to other shells like {{Pkg|bash}}, {{Pkg|zsh}}, {{Pkg|fish}} etc..refer [[Change default shell|change default shell]].
Alpine Linux uses Busybox [[Shell_management#Ash_shell|Ash]] shell for its default shell.  
 
When using Ash shell, one can’t set aliases in the {{Path|~/.profile}}, but environment variables can be set in it. In order to use aliases with Busybox Ash, you must set the ENV environment variable to refer the aliases file.
 
First create the file {{Path|/etc/profile.d/profile.sh}} as follows:
{{Cat|/etc/profile.d/profile.sh|if [ -f "$HOME/.config/ash/profile" ]; then
. "$HOME/.config/ash/profile"
fi
}}
Next create the file {{path|~/.config/ash/profile}} as follows:
{{Cat|~/.config/ash/profile|export ENV{{=}}"$HOME/.config/ash/ashrc"
}}
Now aliases can be added in the file {{Path|~/.config/ash/ashrc}}:
 
{{Cat|~/.config/ash/ashrc|su{{=}}"doas -s"
}}


== vi ==
== vi ==
Line 29: Line 14:


== See also ==
== See also ==
* [https://www.busybox.net/ Official website]
* [https://www.busybox.net/ Official website]
* [https://busybox.net/downloads/BusyBox.html Official BusyBox Manual]
* [https://busybox.net/downloads/BusyBox.html Official BusyBox Manual]
* [http://k.japko.eu/busybox-vi-tutorial.html Busybox vi tutorial]
* [http://k.japko.eu/busybox-vi-tutorial.html Busybox vi tutorial]
[[Category:System Administration]]
[[Category:System Administration]]

Revision as of 04:06, 20 July 2025

Alpine Linux is built around musl libc and busybox. To minimize footprint, Alpine Linux comes with BusyBox by default. BusyBox provides replacements for most of the utilities usually found in GNU coreutils, util-linux, etc. Built-in utility programs called as applets share code for many common operations. Invoking BusyBox with no argument lists the applets that have been compiled into BusyBox binary. Refer BusyBox Manual for options supported by BusyBox.

Ash shell

Alpine Linux uses Busybox Ash shell for its default shell.

vi

Busybox uses tiny vi, a small 'vi' clone. Refer Busybox vi tutorial for an excellent introduction.

Replacing BusyBox utilities

BusyBox is set up as an endpoint for numerous symlinks that substitute various utilities.The utilities in BusyBox generally have fewer options than their full-featured GNU counterparts. If you find certain utilities in busybox lacking in features or options, it is easy to replace respective endpoints by their equivalent full-featured utilities.

See also