1. 创建 shellrc,用来存放对 shell 配置文件的改动

如:


export PATH=$PATH:~/bin
alias ws="cd ~/workspace"



bin 用来存放可执行文件。

 

2. 加入shellrc 到各shell 配置文件

如.bashrc,.zshrc,加入:



if [ -f ~/shellrc ]; then
    . ~/shellrc
fi



然后 source shellrc

        source .bashrc 就行了