mac 裡的bash修改,可開機執行

建立~/.bash_profile 檔案 然後輸入一些想修改的bash命令 比如一下

1
2
3
alias ll = 'ls -l'
alias la = 'ls -a'

然後在/etc/zshrc加入這一行

1
source ~/.bash_profile

這個命令是重新執行~/.bash_profile的意思,然後儲存zshrc,在shell 命令行輸入

1
source /etc/zshrc

或重新開機

就可以永久修改bash_profile且開機就執行,如果沒有修改zshrc,那麼每次都要輸入

1
source ~/.bash_profile
才會執行bash_profile