mac system settings alias

Edit vim ~/.bash_profile
to write the required commands

alias mio="cd /Users/miofly/Documents/mio"

Make the configuration effective

source ~/.bash_profile

Problem:
I configure environment variables in ~/.bash_profile, but the configuration does not take effect every time I restart the terminal. You need to re-execute: $source ~/.bash_profile before it takes effect.
Reason:
I am an environment variable configured in bash, and the current system uses a shell to
view the currently used shell:
terminal input: echo $SHELL
output is /bin/zsh, indicating that the zsh
solution is used:
in .zshrc Add source ~/.bash_profile in the file addition, the method is as follows:
Enter the main directory cd ~
show hidden files, find the .zshrc folder ls -a (if you don’t have it, you can just create it)
edit the file vi .zshrc
press i to enter the editing mode, add source ~/.bash_profile, esc, and then enter: wq save and exit

Guess you like

Origin blog.csdn.net/weixin_40013817/article/details/115269562