2

I've read a lot but I am still confused. Is Bash specifically Unix, while shell, terminal, command line are all "generic terms"?

For example, if I say "shell", it is not yet determined that I'm specifically referring to Linux' shell or MacOS' shell or some other operating system's shell, right?

On the other hand, if I say "Bash", then I'm only talking about Unix, right? Also, a very in-depth explanation of the relations and slightest differences between all of them would be appreciated.

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
Dehsk Plock
  • 27
  • 1
  • 5
  • 1
    See also [Unix & Linux](https://unix.stackexchange.com/q/4126/118235), [Ask Ubuntu](https://askubuntu.com/q/506510/334765), [Stack Overflow](https://stackoverflow.com/q/21014344/3266847), and [Super User](https://superuser.com/q/144666/372008). – Benjamin W. Jun 18 '19 at 23:09
  • Stack Overflow is only for questions about **writing software**. There's nothing software-development-specific about any of this terminology. – Charles Duffy Jun 18 '19 at 23:12

2 Answers2

0

A terminal is the software application on your computer that takes inputs and shows the output.

People usually but incorrectly refer to the terminal and shell interchangeably. The actual definition defines the shell as the command-line interpreter, essentially what translates the input you give to the terminal. So the shell is part of the terminal.

Again, the command-line is what interprets your input, also part of the shell+terminal. It's the text input box.

Bash is an example of a shell. You likely have seen it on Linux or Mac computers. Different shells interpret differently.

Ellime
  • 11
  • 1
  • 3
  • 4
    Much of this is simply false. The shell is *not* part of the terminal; it's a separate program, whose output is (when used interactively) typically displayed in a terminal. A "command line" is a style of interfaces that a shell provides, but there are plenty of programs that aren't UNIX shells that provide command lines. – Charles Duffy Jun 18 '19 at 23:13
  • 1
    And no, `ls` is not a bash command. bash doesn't know what `ls` is at all! It's just a UNIX program that happens to typically be installed on machines that bash is also installed on; but it gets run the same way any other program would be, whether or not that program is standard or built-in or commonly available. – Charles Duffy Jun 18 '19 at 23:14
  • 1
    (Traditionally, it used to be that terminals weren't software at all, but were dedicated pieces of hardware -- first teletypes, printers that would literally put output on paper coupled with keyboards for input, then "glass TTYs", dedicated hardware that did nothing but display output on a built-in screen and collect input). – Charles Duffy Jun 18 '19 at 23:17
  • 1
    Also, `bash` is not *specifically for UNIX*. It also runs on Linux, MacOS and various compatibility environments for Windows such as MinGW and Cygwin. To name but a few ... – Stephen C Jun 18 '19 at 23:18
  • Thanks, all. I definitely oopsied a lot. Though I purposely left my answer as an oversimplification I'm happy to be corrected. – Ellime Jun 18 '19 at 23:29
  • 1
    "People usually refer to the terminal and shell interchangeably." Although some people do use the terms interchangeably, they are wrong to do so. This should be rephrased as "People often incorrectly refer to the terminal and shell interchangeably." – William Pursell Jun 18 '19 at 23:59
  • Good suggestion, I made a note on that. – Ellime Jun 19 '19 at 00:01
0

I typically use the term shell to reference any command line interface, so in Windows I call the DOS prompt the shell, in MacOS and Linux I call bash the shell. Although I don't think the MacOS version of the bash shell works 100% the same as Unix/Linux bash.

Bash stands for Bourne Again Shell and is usually the default shell in Linux systems today, but there are tons of other shells available in Linux like the Korn shell (ksh), Debian Almquist Shell (dash) the Z shell (zsh) and many more.

A comparison of shells can be found here: Comparison of command shells

robgraves
  • 1,314
  • 1
  • 8
  • 14
  • Re MacOS `bash` - see https://stackoverflow.com/questions/10418616/does-darwin-macos-modify-bash. It basically works the same ... but for an older version of bash. See what `bash --version` reports. – Stephen C Jun 18 '19 at 23:33