给命令别名

两种方法。第一种是设置alias 第二种是设置PATH

第一种是临时有效

alias mysql=/usr/local/mysql/bin/mysql

第二种是永久有效

vim /etc/profile.d/path.sh

加入一行

export PATH=$PATH:/usr/local/mysql/bin

保存,执行

source /etc/profile.d/path.sh
原文地址:https://www.cnblogs.com/wangshaojun/p/5042034.html