<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=1something</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=1something"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/1something"/>
	<updated>2026-05-03T03:49:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Shell_management&amp;diff=32359</id>
		<title>Shell management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Shell_management&amp;diff=32359"/>
		<updated>2026-05-02T00:26:51Z</updated>

		<summary type="html">&lt;p&gt;1something: /* Available shells */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The default shell used by Alpine Linux is the [[BusyBox]] variant of the [[BusyBox#Ash_shell|ash]] shell. This page explains how to use the default shell and various ways to change the default shell in Alpine Linux. &lt;br /&gt;
&lt;br /&gt;
== Ash shell == &lt;br /&gt;
&lt;br /&gt;
Alpine Linux uses [[Busybox]] Ash shell for its default shell. It is a standard POSIX shell derived from Debian Ash variant. &lt;br /&gt;
&lt;br /&gt;
One&#039;s ~/.bashrc file (or, alternatively, a different shell alias file) could be considered as a basis, say, for an {{Path|~/.ashrc}} file, reviewing it carefully for syntax/cli variants against that of Ash shell. For non-login, interactive shells refer to [[#Setting alias|Setting alias]] section.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Use {{pkg|checkbashisms}} script to perform basic checks for the presence of bashisms in scripts and help remove them.}}&lt;br /&gt;
&lt;br /&gt;
=== Setting alias ===&lt;br /&gt;
&lt;br /&gt;
For non-login shells, Busybox Ash and other POSIX shells do NOT automatically read a startup file like {{Path|~/.ashrc}}. To ensure that both login and non-login shells work consistently, use &#039;&#039;&#039;ENV&#039;&#039;&#039; environment variable in {{Path|~/.profile}} to refer {{Path|~/.ashrc}} file. &lt;br /&gt;
&lt;br /&gt;
# Edit the {{Path|~/.profile}} as follows: {{Cat|~/.profile|&amp;lt;nowiki&amp;gt;...&lt;br /&gt;
export ENV=&amp;quot;$HOME/.ashrc&amp;quot; &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# Now aliases can be added in the startup file {{Path|~/.ashrc}} as follows: {{Cat|~/.ashrc|&amp;lt;nowiki&amp;gt;# ~/.ashrc: interactive shell configuration for BusyBox Ash&lt;br /&gt;
&lt;br /&gt;
# Custom Aliases&lt;br /&gt;
alias ls=&#039;ls --color=auto&#039;&lt;br /&gt;
alias grep=&#039;grep --color=auto&#039;&lt;br /&gt;
&lt;br /&gt;
# You may want to put all your additions into a separate file like&lt;br /&gt;
# ~/.ash_aliases, instead of adding them here directly.&lt;br /&gt;
&lt;br /&gt;
if [ -f ~/.ash_aliases ]; then&lt;br /&gt;
    . ~/.ash_aliases&lt;br /&gt;
fi&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Available shells ==&lt;br /&gt;
&lt;br /&gt;
Most of the popular shells are available in Alpine Linux repositories as can be seen from the below list. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot; style=&amp;quot;width:100%; border:1px #0771a6 solid; background:#f9f9f9; text-align:left; border-collapse:collapse;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background:#333333; color:#ffffff; font-size: 1.2em; text-align:center;&amp;quot;&lt;br /&gt;
|width=&amp;quot;10%&amp;quot; | Name &lt;br /&gt;
|width=&amp;quot;36%&amp;quot; | URL &lt;br /&gt;
|Remarks&lt;br /&gt;
|-&lt;br /&gt;
|{{Pkg|bash}}|| https://www.gnu.org/software/bash/bash.html||The GNU Bourne Again shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|dash}} ||http://gondor.apana.org.au/~herbert/dash/||Small and fast POSIX-compliant shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|elvish}} ||https://elv.sh||Friendly and expressive Unix shell&lt;br /&gt;
|-&lt;br /&gt;
|{{Pkg|fish}} ||https://fishshell.com/||Modern interactive commandline shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|loksh}} ||https://github.com/dimkr/loksh||A Linux port of OpenBSD&#039;s ksh&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|mksh}} ||http://www.mirbsd.org/mksh.htm||MirBSD&#039;s fork of ksh&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|murex}} ||https://murex.rocks/||Intuitive, typed and content aware shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|nsh}} ||https://github.com/nuta/nsh||A command-line shell like fish, but POSIX compatible&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|nushell}} ||https://www.nushell.sh||A new type of shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|oksh}} ||https://github.com/ibara/oksh||Portable OpenBSD ksh, based on pdksh&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|tcsh}} ||https://github.com/tcsh-org/tcsh||extended C-shell&lt;br /&gt;
|-&lt;br /&gt;
|{{pkg|yash}} ||https://magicant.github.io/yash||Yet another shell&lt;br /&gt;
|-&lt;br /&gt;
|{{Pkg|zsh}} || https://www.zsh.org/||Very advanced and programmable command interpreter&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To install any of the above shells, say for eg: {{pkg|bash}} shell: {{Cmd|# apk add {{pkg|bash}} {{pkg|bash-completion}}}}&lt;br /&gt;
&lt;br /&gt;
== Change default shell == &lt;br /&gt;
&lt;br /&gt;
There are various ways to change the default user shell in Alpine Linux. You can revert back to [[#ash|ash]] shell at anytime with the same steps. &lt;br /&gt;
&lt;br /&gt;
{{Note|You need to log out and login again for these changes to take effect.}}&lt;br /&gt;
&lt;br /&gt;
=== Using chsh command ===&lt;br /&gt;
&lt;br /&gt;
To use {{ic|chsh}} command, install the {{pkg|shadow}} package: {{Cmd|# apk add shadow}}&lt;br /&gt;
And use chsh: {{Cmd|# chsh username}}&lt;br /&gt;
Now enter the path for the shell you want to use (e.g {{Path|/bin/zsh}})&lt;br /&gt;
and press {{Key|Enter}} to confirm this change. The shell should exist in {{Path|/etc/shells}}.&lt;br /&gt;
&lt;br /&gt;
=== By hand ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Take care not to delete/mangle the line, as it would make you unable to log in again.}}&lt;br /&gt;
&lt;br /&gt;
Edit {{Path|/etc/passwd}} manually using an editor of your choice. An example line for a user named &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; is: {{Cat|/etc/passwd|...&lt;br /&gt;
user:x:1000:1000:user:/home/user:/bin/ash&lt;br /&gt;
...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Change {{Path|/bin/ash}} to point to the path of a shell from {{Path|/etc/shells}}. The &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; should be the user you are changing the default login shell for.&lt;br /&gt;
&lt;br /&gt;
== /bin/sh ==&lt;br /&gt;
&lt;br /&gt;
Most applications expect a POSIX-compliant shell to be present in a standard location, {{Path|/bin/sh}}. In Alpine Linux, {{Path|/bin/sh}} is linked to [[#Ash shell|Busybox ash]] by default, but you can change this by installing an alternate {{pkg|*-binsh}} package. Changing {{Path|/bin/sh}} may lead to a difference in script execution speed.&lt;br /&gt;
&lt;br /&gt;
To use {{pkg|dash}} shell as {{Path|/bin/sh}}:{{Cmd|# apk add {{pkg|dash-binsh}}}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://linux.die.net/man/1/dash dash Manual]&lt;br /&gt;
* [https://git.busybox.net/busybox/tree/shell/README Ash README]&lt;br /&gt;
* [https://git.busybox.net/busybox/tree/shell Ash source code]&lt;br /&gt;
* [https://pubs.opengroup.org/onlinepubs/9799919799/ POSIX standard]&lt;br /&gt;
* [https://stackoverflow.com/questions/38024160/how-to-get-etc-profile-to-run-automatically-in-alpine-docker/38025686#38025686 stackoverflow on ash shell]&lt;br /&gt;
&lt;br /&gt;
[[Category:Shell]]&lt;br /&gt;
[[Category:System Administration]]&lt;/div&gt;</summary>
		<author><name>1something</name></author>
	</entry>
</feed>