mac 设置 ll 等alias 并永久生效

  往上看了在.bash_profile中配置 然后 source  的方法, 试过了, 只是当前的终端有效,当电脑重启或者关闭终端就失效了,只好看看 mac 的 profile 代码

# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`    ###将环境路径进行添加
fi

if [ "${BASH-no}" != "no" ]; then
    [ -r /etc/bashrc ] && . /etc/bashrc  
 ###很明显这个是加载etc/bashrc的用途 虽然我不明白 -r 表示什么意思
fi
### 模仿上面我新建一个文件 AliasDIY 如下
if [ -x /etc/AliasDIY ]; then
    [ -r /etc/AliasDIY ] && . /etc/AliasDIY
fi
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home"
CLASS_PATH="$JAVA_HOME/lib"
PATH=".:$PATH:$JAVA_HOME/bin"




以下是 AliasDIY 内容   ---这样就永久生效了

alias mysql='/usr/local/mysql/bin/mysql’ 
alias mysqladmin='/usr/local/mysql/bin/mysqladmin’
alias ll='ls -alF'
alias la='ls -A'
I'm falling off the sky all alone.The courage inside is gonna break the fall. Nothing can dim my light within. I am That I am 程序 = 数据结构 + 算法
原文地址:https://www.cnblogs.com/IamThat/p/4355745.html