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?
 


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
 
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
 
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.
 
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.
 
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.
 
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?
 
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.
 
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?
 
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"
 
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
 

Staff online


Top