Bash Shell – Why Is Bash the Default Shell in Most OS?

bashdefaulthistory-of-ubuntuzsh

Why is bash the default shell in most OSes (Ubuntu, Fedora, OSX, etc.)? Why is it that a lot of advanced users mostly use zsh? If it is that good, why is it not the default?

I use both I don't see a difference for all my tasks are simple 🙂

Best Answer

I did some reading on this and the conclusion seems to be that it is the default shell of GNU (used by most Linux based OS), and therefore simply comes packaged as part of GNU, while also having 20 years of development behind it making it stable and well rounded, it is simply the best all rounder, meeting the needs of all but the most advanced users.

For more, read Why is bash standard on Linux? (the same question on Unix & Linux).

Just to add a bit more to this, there are many other shells to try, if you are interested, here's a few from this answer:

  • Zsh has more advanced interactive facilities, but a few quirks when it comes to scripting (less so now than back in the days). In the early to mid-1990s when Linux was in its infancy, zsh was virtually unknown.

  • Ksh was the de facto standard on commercial unices since the mid-1980s, but it was proprietary software until 2000, so not an option on Linux. Also, ksh had subpar command line editing capabilities, compared with bash.

  • Pdksh, a free clone of ksh, would have been an option, but it was not well-known and had poor command line edition capabilities. (Pdksh is no longer a very active project, even though it's still used in some BSDs, now that ATT ksh is free.)

  • Some distributions install an ash variant as /bin/sh. Ash (by which I mean any of the loose family of shells called ash) is designed to be small and fast, with no interactive features (it's only for editing scripts). The ash revival is relatively recent; in the 1990s the existing variants lacked a lot of features.

  • Tcsh was the most advanced interactive shell until zsh came along, but it's incompatible with sh and not so good with scripting.