What’s the difference between bash and default terminal?

acornator

New Member
Joined
Feb 5, 2023
Messages
10
Reaction score
0
Credits
74
I am very very new to Linux, and when I’m installing anaconda, I noticed that the conda command can only be used after I type “bash” and start using the bash console. What’s the difference between bash and the default terminal?
 


f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
6,404
Reaction score
4,857
Credits
47,060
If you are talking about the following file to install anaconda?
Code:
-rw-r--r--. 1 maarten maarten 773428196 Feb  5 18:41 Anaconda3-2022.10-Linux-x86_64.sh
Because the file isn't executable when you download it, by putting bash in front of it will know that it should open a sub-shell toe execute it. You could also just give the file execute permissions and then run it, like this.
Code:
chmod +x Anaconda3-2022.10-Linux-x86_64.sh
./Anaconda3-2022.10-Linux-x86_64.sh
 
OP
A

acornator

New Member
Joined
Feb 5, 2023
Messages
10
Reaction score
0
Credits
74
If you are talking about the following file to install anaconda?
Code:
-rw-r--r--. 1 maarten maarten 773428196 Feb  5 18:41 Anaconda3-2022.10-Linux-x86_64.sh
Because the file isn't executable when you download it, by putting bash in front of it will know that it should open a sub-shell toe execute it. You could also just give the file execute permissions and then run it, like this.
Code:
chmod +x Anaconda3-2022.10-Linux-x86_64.sh
./Anaconda3-2022.10-Linux-x86_64.sh
Im talking about after installing anaconda, I cant use the "conda" command in the terminal, but I have to first type base to get into a bash terminal and then conda command is usable
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
6,404
Reaction score
4,857
Credits
47,060
Normally the Anaconda installer asks you at the end of the installation if you want to activate Anaconda automatically at the end of the installation which looks like this.
Code:
Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
It then adds the following to your ~/.bashrc
Code:
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/opt/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<
It's that or you can add the following to your ~/.bashrc.
Code:
source /opt/anaconda3/bin/activate
Replacing /opt with whatever path you installed Anaconda in.
 

MattWinter

Active Member
Joined
Dec 5, 2022
Messages
175
Reaction score
220
Credits
1,291
Maybe this isn't what you're talking about, but normally bash is the default terminal. However. This can be changed. You can set a different shell as default, and I think some distributions have a different default.
 

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
3,385
Reaction score
1,753
Credits
19,661
Bash is the command line interpreter for anything that you run in the terminal.

The default terminal is the terminal or konsole that came with the Linux distro that you installed.
 

sphen

Well-Known Member
Joined
Dec 12, 2022
Messages
868
Reaction score
751
Credits
10,394
I am seeing three intertwined topics here:
  • TERMINAL: The terminal window is where you can type text commands and see the results.
    • The terminal gives you a window to type and see the text.
    • The terminal does not "understand" the text.
  • SHELL: A shell runs in the terminal window and "understands" the commands that you type.
    • The shell is the invisible part that interprets the text and tries to process the commands. The shell also runs shell scripts, which are programs that are run from files with shell commands in them.
    • -> A popular shell in Linux is the "bash" shell.
    • Other well-known shells are "zsh", the Korn shell, and the older Bourne shell upon which bash is based.
    • You can choose a default shell for your terminal window. You can also change shells with a command, without changing the default.
  • ANACONDA: Specialized questions related to Anaconda and the need to launch a shell separately so you can type the "conda" command. I can't help with those questions.
Does that clarify things?
 
OP
A

acornator

New Member
Joined
Feb 5, 2023
Messages
10
Reaction score
0
Credits
74
I am seeing three intertwined topics here:
  • TERMINAL: The terminal window is where you can type text commands and see the results.
    • The terminal gives you a window to type and see the text.
    • The terminal does not "understand" the text.
  • SHELL: A shell runs in the terminal window and "understands" the commands that you type.
    • The shell is the invisible part that interprets the text and tries to process the commands. The shell also runs shell scripts, which are programs that are run from files with shell commands in them.
    • -> A popular shell in Linux is the "bash" shell.
    • Other well-known shells are "zsh", the Korn shell, and the older Bourne shell upon which bash is based.
    • You can choose a default shell for your terminal window. You can also change shells with a command, without changing the default.
  • ANACONDA: Specialized questions related to Anaconda and the need to launch a shell separately so you can type the "conda" command. I can't help with those questions.
Does that clarify things?
Thank you for the reply. I guess what I dont understand is why the "conda" command only works after I first type in "bash" which opens a subprocess inside my main terminal process. Like if I just type conda, itll say command not found, but after I first type bash and it enters the subprocess, I can then type conda itll be able to do whatever that command can do.
 
OP
A

acornator

New Member
Joined
Feb 5, 2023
Messages
10
Reaction score
0
Credits
74
I am seeing three intertwined topics here:
  • TERMINAL: The terminal window is where you can type text commands and see the results.
    • The terminal gives you a window to type and see the text.
    • The terminal does not "understand" the text.
  • SHELL: A shell runs in the terminal window and "understands" the commands that you type.
    • The shell is the invisible part that interprets the text and tries to process the commands. The shell also runs shell scripts, which are programs that are run from files with shell commands in them.
    • -> A popular shell in Linux is the "bash" shell.
    • Other well-known shells are "zsh", the Korn shell, and the older Bourne shell upon which bash is based.
    • You can choose a default shell for your terminal window. You can also change shells with a command, without changing the default.
  • ANACONDA: Specialized questions related to Anaconda and the need to launch a shell separately so you can type the "conda" command. I can't help with those questions.
Does that clarify things?
Thank you for the reply. I guess what I dont understand is why the "conda" command only works after I first type in "bash" which opens a subprocess inside my main terminal process. Like if I just type conda, itll say command not found, but after I first type bash and it enters the subprocess, I can then type conda itll be able to do whatever that command can do.
ohhhhh, I just realized why. The default shell of manjaro use ZSH, and conda for some reason only works for bash. Is there a way to configure it to also work in zsh?
 
OP
A

acornator

New Member
Joined
Feb 5, 2023
Messages
10
Reaction score
0
Credits
74
ohhhhh, I just realized why. The default shell of manjaro use ZSH, and conda for some reason only works for bash. Is there a way to configure it to also work in zsh?
yay, I just solved! I jusst had to do "conda init zsh"
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
9,184
Reaction score
8,138
Credits
39,432
Good work :)

If you like you can return to your first Post and choose Edit to add to the title [SOLVED].

Yes on Manjaro, they changed it to zsh in the last 12 months or so.

Because it is a Rolling release, I am still on bash and plan to stay there for now.

Cheers

Chris Turner
wizardfromoz
 

Members online


Top