How do I create a Bash alias?

后端 未结 16 698
一个人的身影
一个人的身影 2020-11-28 17:38

I\'m on OSX and I need to put something like this, alias blah=\"/usr/bin/blah\" in a config file but I don\'t know where the config file is.

16条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 18:19

    For macOS Catalina Users:

    Step 1: create or update .zshrc file

    vi ~/.zshrc
    

    Step 2: Add your alias line

    alias blah="/usr/bin/blah"
    

    Step 3: Source .zshrc

    source ~/.zshrc 
    

    Step 4: Check you're alias, by typing alias on the command prompt

    alias
    

提交回复
热议问题