-2

I've been using Linux Mint since March 2020, and I haven't used any shells other than the Bash shell.

So what exactly is the difference between the Bash shell and the other shells (Fish, Zsh, Ksh, Tcsh, C shell)? Are the commands different? Or is it the features? Or something else?
;)Please help the newbie understand shells!

Wade Wayne
  • 121
  • 8
  • That question is a bit broad and has no real problem. In general: syntax differs, and so do capabilities and features as well as sometimes even [expected behaviour](https://stackoverflow.com/a/12412/5114441). Even which shell is standard differs between UNIX flavours .... exept for POSIX-sh of course. – FelixJN Apr 07 '21 at 20:35
  • https://en.wikipedia.org/wiki/Comparison_of_command_shells – KGIII Apr 07 '21 at 20:36
  • [Fish for bash users](https://fishshell.com/docs/current/fish_for_bash_users.html) – glenn jackman Apr 07 '21 at 20:41
  • See Gilles' answer in [What are the fundamental differences between the mainstream *NIX shells?](https://unix.stackexchange.com/q/3320/170373), which is from 2010 originally, but seems pretty much on point. It also has links, including this little lecture on history: [Why is Bash everywhere (in most if not all Linux distributions)?](https://superuser.com/q/61727/600133) (on superuser.com) – ilkkachu Apr 07 '21 at 21:17
  • In brief: POSIX sh is the bare common base. Ksh added useful features to it, most of which were then borrowed in to Bash. Zsh added more usefulness (witness half the answers here) but in different ways, being arguably saner but breaking compatibility too. Fish tries to be what the name says: a nice interactive shell. If you're aiming scripting, you may want to learn Zsh (and POSIX sh if you need compatibility). If interactive use, Zsh or fish. Bash isn't that bad either, though. Forget about (t)csh. – ilkkachu Apr 07 '21 at 21:27
  • Honestly, I'm going to have to flag this one as being "Primarily opinion based". The problem is that you could end up with dozens of answers, all of them right. Stack Exchange isn't designed for this type of "discussion". Better to use Reddit, but make sure you find the right subreddit (perhaps r/linux) and check their rules first. That said, of the ones you listed, all except for `fish` (and the ancient `c shell`) are "POSIX compliant" (as long as you don't use shell-specific features that *aren't*). `fish` offers a more modern, (IMHO) better syntax, but you sacrifice compatibility. – NotTheDr01ds Apr 07 '21 at 22:09
  • Also try [Hyperpolyglot - Unix Shells: Bash, Fish, Ksh, Tcsh, Zsh](https://hyperpolyglot.org/unix-shells) – NotTheDr01ds Apr 07 '21 at 22:13

1 Answers1

1

The primary role of a shell is to let you run the programs that are installed on your system. As a consequence, all command line shells let you run pretty much the same commands. The differences are a very small number of commands that are built into the shells themselves, which vary a little between shells.

Shells differ mainly in terms of their programming facilities and their command line capabilities (completion, history recall, syntactic convenience, etc.). See What are the fundamental differences between the mainstream *NIX shells?. Shells are responsible for command line edition and this too varies between shells.

For interactive use, bash is the default on Linux, zsh is the default on macOS. If you've started to get used to bash, you can read my guide to why zsh is better. The only other serious contender for interactive use is fish which has nice defaults but little configurability.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175