BusyBox: Difference between revisions
Prabuanand (talk | contribs) (cleaned up the page) |
Prabuanand (talk | contribs) (removed duplicate information) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Alpine Linux is built around musl libc and [https://www.busybox.net/ busybox]. BusyBox provides replacements for most of the utilities usually found in GNU coreutils, util-linux, etc | Alpine Linux is built around musl libc and [https://www.busybox.net/ 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 [https://busybox.net/downloads/BusyBox.html BusyBox Manual] for options supported by BusyBox. | ||
Refer [https://busybox.net/downloads/BusyBox.html BusyBox Manual] for options supported by BusyBox. | |||
== Ash shell == | == 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 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]]. | ||
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. | 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. | ||
Line 23: | Line 19: | ||
{{Cat|~/.config/ash/ashrc|su{{=}}"doas -s" | {{Cat|~/.config/ash/ashrc|su{{=}}"doas -s" | ||
}} | }} | ||
== vi == | |||
Busybox uses [https://git.busybox.net/busybox/plain/editors/vi.c tiny vi], a small 'vi' clone. Refer [http://k.japko.eu/busybox-vi-tutorial.html Busybox vi tutorial] for an excellent introduction. | |||
== Replacing BusyBox Utilities== | == Replacing BusyBox Utilities== | ||
{{Main|How to get regular stuff working}} | {{Main|How to get regular stuff working}} | ||
If you find certain utilities in busybox lacking in features or options, it is easy to [[How to get regular stuff working|replace]] respective endpoints by their equivalent full-featured 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 [[How to get regular stuff working|replace]] respective endpoints by their equivalent full-featured utilities. | ||
== 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] | |||
[[Category:System Administration]] | [[Category:System Administration]] |
Latest revision as of 08:04, 7 November 2024
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 for its default shell. To change the default shell to other shells like bash, zsh, fish etc..refer change default shell.
When using Ash shell, one can’t set aliases in the ~/.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 /etc/profile.d/profile.sh as follows:
Contents of /etc/profile.d/profile.sh
Next create the file ~/.config/ash/profile as follows:
Contents of ~/.config/ash/profile
Now aliases can be added in the file ~/.config/ash/ashrc:
Contents of ~/.config/ash/ashrc
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.