I want to add persistent aliases on my Kali Linux installation and I can't get it to work. All answers I come across is to either add them to ~/.bashrc or to ~/bash_aliases (better and recommended), but these don't work for me. Each time I open a new terminal I have to type source ~/.bash_aliases to import them.

What I could be doing wrong?


I had to dig deeper and after a while I've discovered that in my home directory there are also the following files: .zshrc and .zshrc_history. After I've searched kali zshrc phrase this article pops out:

Apparently, since Kali Linux 2020.4 default shell is no longer bash, but zsh, so:

To add persistent aliases to the Kali Linux on release 2020.4 and newer, create ~/.shell_aliases file with your aliases content and reference it in the ~/.zshrc file as following:

if [ -f ~/.shell_aliases ]; then
    . ~/.shell_aliases

Of course .shell_aliases is just an example, name it as you like as long as it doesn't conflict with anything and is correctly referenced in the ~/.zshrc.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.