Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Bash shell and Bash terminal?

Tags:

bash

terminal

Ok, I hope this question makes some sense but what is the difference between a bash shell and a bash terminal? Example. When I first open up terminal I have a prompt with my current dir and my user name. In the terminal window header it says -bash- , when I type echo $SHELL I get bash. So by default the shell is bash. Where my confusion comes into play is when I type bash. My prompt then goes to bash-3.2$.Obviously it's a different mode. Are ther any major differences? I have read the man page with no answer. I understand what a bash shell is but just do not get the difference. Thanks for the clarity in advance.

like image 451
Gmenfan83 Avatar asked Jan 27 '12 23:01

Gmenfan83


People also ask

Is bash shell and terminal same?

No. A terminal is a text input and output environment. A physical terminal is referred to as a console. The shell is a command-line interpreter.

What is the difference between shell and terminal?

The Shell is the name of the program that runs in the terminal (command line interpreter). It can be also seen as a program that processes commands and returns output because it is like an application running commands.

Is shell different from bash?

Bash scripting is a subset of shell scripting. Shell scripting is a method to automate tasks as a collection of commands. The bash script is one form of shell script. Shells may be one of Korn, C shell, Bourne, Bash, etc.

Why is terminal called shell?

It is named a shell because it is the outermost layer around the operating system.


1 Answers

There is no difference, they are both instances of the bash shell.

The reason you are seeing a different prompt is that your initial login shell sources ~/.bash_profile where presumably you have your prompt set. When you type bash it invokes another shell but because this one isn't a login shell, it doesn't source ~/.bash_profile and so you get the default prompt.

If you were call bash -l, (which invokes bash as if it were a login shell) I bet you would see that your original prompt remains

like image 87
SiegeX Avatar answered Oct 13 '22 06:10

SiegeX