zoukankan      html  css  js  c++  java
  • How to add alias on Mac(It's common for most system)

    Since these files are hidden you will have to do an ls -a to list them. If you don't have one you can create one.

    Update:

    If I remember correctly, when I had bought my mac, .bash_login file wasn't there. I had to create it for myself so that I could put prompt infoaliasfunctions etc in it. Here are the steps if you would like to create one -

    1. Start up Terminal
    2. Type cd ~/ to go to your home folder
    3. Type touch .bash_profile to create your new file.
    4. Edit .bash_profile with your favorite editor (or you can just type open -e .bash_profile to open it in TextEdit.
    5. Type . .bash_profile to reload .bash_profile and update any alias you add.

    Another covenient way:

    The config file for scripts and programs is ~/.bashrc and the config file that gets loaded when you use Terminal is ~/.bash_login.

    I think the best way is to just have everything in ~/.bashrc.

    For your specific question just enter (this will overwrite any existing ~/.bashrc):

    echo "alias blah="/usr/bin/blah"" >~/.bashrc

    into the Terminal and a ~/.bashrc file will be created with your new alises. After that just edit the file to add new aliases, functions, settings etc.

  • 相关阅读:
    GotoAndPlay 图论
    P1965 转圈游戏  快速幂
    双栈排序 图论
    威尔逊定理 数学
    n!mod p 的求法 数学
    P3195 [HNOI2008]玩具装箱TOY DP+优化
    loj6485. LJJ 学二项式定理
    loj6539. 奇妙数论题
    loj535. 「LibreOJ Round #6」花火
    loj534. 「LibreOJ Round #6」花团
  • 原文地址:https://www.cnblogs.com/airwindow/p/4055157.html
Copyright © 2011-2022 走看看