ZSH not recognizing my aliases?

75,532

Solution 1

if you do a very simple alias in zsh, does it work? open your .zshrc file, and add the following line:

alias ls='ls -GpF'

after adding that line, type this line in your Terminal:

source ~/.zshrc

tell us what happens. Also, just for shiggles, make sure you are using single quotes vs. double quotes, I have seen that make a difference in the past on different versions of shells/OS/whatnot.

Solution 2

Add "source ~/.bash_profile" to your ~/.zsh config file.

Solution 3

Put this line:

/source: 'source ~/.bash_profile' into ~/.zshrc 

Solution 4

After saving changes in ~/.zshrc file, open a new shell window and execute the command in it.

Solution 5

Sometimes the simple solution is what we need... Add "source ~/.bash_profile" to your ~/.zshrc config file

echo source ~/.bash_profile >>  ~/.zshrc
Share:
75,532
o_O
Author by

o_O

Updated on July 05, 2022

Comments

  • o_O
    o_O almost 2 years

    Using iTerm2 with zsh and it isn't recognizing my aliases. Sometimes I have to work in an IDE and can't just easily vim something and the stupid people thought it a good idea to name their applications like MyReallyLongApplicationName.app and since .html files open by default in browsers, I have to:

    open -a MyReallyLongApplicationName.app something.html
    

    I have an alias in my .zshrc like:

    alias ide="open -a MyReallyLongApplicationName.app"
    

    But zsh won't recognize my aliases. I tried another one just to see if it was me but none of the aliases I create are recognized. Just get "zsh: command not found: ide" or whatever.

    So I'm not sure what I'm doing wrong and I've been searching around all day trying to fix things in zsh and the like. As a note, I'm not a pro at Linux/Unix systems so if you're too technical and vague I probably won't understand what you're telling me.

    Thanks!