BusyBox: Difference between revisions

From Alpine Linux
(created page with links to official site and man page and draft notice)
 
(Added aliases instructions based on http://redd.it/1g8924f by reddit user SaltyMaybe7887)
Line 4: Line 4:


BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system.
BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system.
== Ash shell ==
Alpine uses Busybox Ash for its default shell.
=== using aliases ===
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 the file where you define your aliases.
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"
}}


== See Also ==
== See Also ==
* [https://www.busybox.net/ Official website]
* [https://www.busybox.net/ Official website]
* [https://man.archlinux.org/man/busybox.1.en Online Manual]
* [https://man.archlinux.org/man/busybox.1.en Online Manual]

Revision as of 13:58, 21 October 2024

BusyBox: The Swiss Army Knife of Embedded Linux.

This material is work-in-progress ...

This page is still being created
(Last edited by Prabuanand on 21 Oct 2024.)

BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system.

Ash shell

Alpine uses Busybox Ash for its default shell.

using aliases

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 the file where you define your aliases.

First create the file /etc/profile.d/profile.sh as follows:

Contents of /etc/profile.d/profile.sh

if [ -f "$HOME/.config/ash/profile" ]; then . "$HOME/.config/ash/profile" fi

Next create the file ~/.config/ash/profile as follows:

Contents of ~/.config/ash/profile

export ENV="$HOME/.config/ash/ashrc"

Now aliases can be added in the file ~/.config/ash/ashrc:

Contents of ~/.config/ash/ashrc

su="doas -s"


See Also