Skip to content

Instantly share code, notes, and snippets.

@ThaddeusJiang
Last active July 25, 2018 01:21
Show Gist options
  • Save ThaddeusJiang/63c1b07bd4404a224d9b24de303f7f55 to your computer and use it in GitHub Desktop.
Save ThaddeusJiang/63c1b07bd4404a224d9b24de303f7f55 to your computer and use it in GitHub Desktop.
Mac 设置命令别名

步骤

  1. 切换到用户主目录
  2. 编辑或新建.bash_profile文件
  3. 添加别名

命令别名设置语法:

alias [别名]='[指令名称]'

注意:等号两边均无空格,指令名称中如有空格,需用引号包裹

🌰:

alias ll='ls -l'
  1. 重载该配置文件
$ source .bash_profile
  1. 查看当前所有别名设置
$ alias

注:Mac别名设置与Linux大体相同,仅配置文件不同。可参考Linux alias命令

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment