问题
I want to permanently store zsh aliases. When I make an alias and shut down ITerm and reopen and it's gone!
alias mkcd="function _mkcd(){mkdir "$1"; cd "$1"} _mkcd"
mkcd Ken
zsh: command not found: mkcd
How can I make it permanent?
回答1:
Create a file .zshrc
in your home directory if it does not exist already and add the alias to the file.
Next time when you open the terminal. It will be available.
To use it in the same session, just source the .zshrc
file by running the command . .zshrc
from your home directory.
来源:https://stackoverflow.com/questions/56044309/how-to-make-a-permanent-zsh-alias-in-command-line