Off topic:Mac Os Users: Script Paths And Aliases In .Bash_Profile Or .Bashrc Or Both?
1
0
Entering edit mode
11.6 years ago
Josh Herr 5.8k

Excuse me if this is a stupid question, but I was searching through the archives and couldn’t find it discussed previously. I was going through a couple of previous posts: (here and here) on people’s preferred aliases and adding some of these useful aliases to my .bash_profile.

Let me preface this by saying I use Mac OS X. When adding these aliases, I realized I’ve previously put aliases in both my .bash_profile and my .bashrc file on my computer, but there wasn’t really any rhyme or reason to the file I used at the time.

I call upon my .bashrc file with:

if 
    [ -f ~/.bashrc ]; 
then
    source ~/.bashrc fi

from within my .bash-profile file.

I know (essentially) the difference between the .bash_profile and .bashrc files on a Mac, but I think I will put all my aliases in my .bashrc file, mainly so I can transfer it to remote computers (all unix based) instead of modifying each .bashrc file for each computer I login to?

In other words, for Mac users, what do you have in your .bashprofile and your .bashrc files? I have my PATHs in my .bashprofile and aliases in my .bashrc, should I put aliases in both or is this just a waste of my time and processing speed? How do you have these files organized so you call your scripts up in the most efficient way? Efficient in terms of your organizational sanity and also computational speed? Does computational speed even matter in this context? ...or do I even need the .bashrc file on my Mac?

Thanks so much for your input in advance!

bash scripting • 4.1k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2618 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6