How to find out where alias (in the bash sense) is defined when running Terminal in Mac OS X

后端 未结 10 1136
时光取名叫无心
时光取名叫无心 2020-12-13 03:50

How can I find out where an alias is defined on my system? I am referring to the kind of alias that is used within a Terminal session launched from Mac OS X (10.6.3).

10条回答
  •  旧时难觅i
    2020-12-13 03:50

    For more complex setups (e.g. when you're using a shell script framework like bash-it, oh-my-zsh or the likes) it's often useful to add 'alias mysql' at key positions in your scripts. This will help you figure out exactly when the alias is added.

    e.g.:

    echo "before sourcing .bash-it:"
    alias mysql
    . $HOME/.bash-it/bash-it.sh
    echo "after sourcing bash:"
    alias mysql
    

提交回复
热议问题