How to add alias on Mac (It's common for most system)

Source: Internet
Author: User

Since These files is hidden you'll have the to do a to ls -a 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 info , alias functions etc in it. Here is the steps if you would like to create one-

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

Another covenient:

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

I think the best just has everything in ~/.bashrc .

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

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

Into the Terminal and a ~/.bashrc file is created with your new alises. After this just edit the file to add new aliases, functions, settings etc.

How to add alias on Mac (It's common for most system)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.