.bashrc and .zsrc

I’m a bit confused, which shell does ParrotOS use by default?

If I do
echo $0
it returns
bash
but if I look in my home folder I do not see a .bashrc only a .zshrc

I want to add a couple of aliases
In the home folder there is a .bash_history
Or is there another folder where the .bashrc is?


  • ParrotOS iso in use:

  • Application used for flashing the iso:

  • Logs/Terminal output (use pastebin or similar services):

  • Screenshots:

  • ParrotOS iso in use: Parrot-security-5.3_amd64
  • Application used for flashing the iso: balenaEtcher-Portable-1.18.4
  • Logs/Terminal output (use pastebin or similar services): N/A
  • Screenshots: N/A
locate .bashrc

https://www.cyberciti.biz/faq/search-for-files-in-bash/

you can also check your /etc/passwd file and loof for your name. The last field will identify the default shell you use.
If you would like to change it, you can modify that field.

check out man 5 passwd

Thank you for the answers, but that doesn’t solve my issue.

Maybe if I ask: in which file can I add my aliases when I add them to the .zhrc they are not picked up

the passwd file tells you what shell is the default for the user
you can determine what shell you are currently using with : ps -p$$

Once you’ve verified your default shell is bash, create a .bashrc file in your ~ and place your aliases in there OR create a separate .bash_aliases file and reference that in your .bashrc file

for example, my .bashrc file has this:

Blockquote

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

Blockquote


I like this approach since if the .bashrc ever gets overwritten with an update or upgrade or rebuild you haven’t lost your aliases. You can even include the if statements in your .bash_aliases file as a comment so you can quickly copy it back if you lose it in an overwrite.

You can test whether this works by logging out and logging in and trying the alias you placed in those files.

the .zshrc file will be read when/if you switch to that shell

Lots of great advice and info guys but that still does NOT answer the question. I have the same issue…what happened to the .bashrc file that used to reside in the home directory? I tried to locate .bashrc and it finds nothing.

Please help

looks like ParrotOS does not create a .bashrc file by default.
simply create one and add your aliases and other user specific customization’s (see examples above).
here is a screenshot of my quick test:

for the system to see the .bashrc file you need to logout out and in again or source it ( . ~/.bashrc or exec bash)

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.