Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3597804
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:09:52+00:00 2026-05-18T20:09:52+00:00

As I understand it, the order that start-up files are read by the bash

  • 0

As I understand it, the order that start-up files are read by the bash shell on a Mac are…

  1. ~/.bash_profile
  2. ~/.bash_login
  3. ~/.profile

..and once one file in this list is found, the contents of the other is ignored.

That being said, is there a best practice for which of these files should be my one true Bash start-up file?

On one hand, if .bash_profile will take precedence over any other potential start-up file, then that should be used, because you can be sure that 100% of the time the info in that start-up file is being run.

On the other hand, if .profile is the file that exists on Mac systems by default, and .bash_profile needs to be manually created, then perhaps that should be used, and there will never be a reason to create a .bash_profile file.

Thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:09:52+00:00Added an answer on May 18, 2026 at 8:09 pm

    It depends on whether you use shells other than bash, and whether you use bash-only features in your profile. If you use other sh-style shells (sh, ksh, zsh, etc but not csh or tcsh), don’t use bash-only features and want the same setup no matter what shell you’re in, you should use .profile. If you want to use bash-only features, use .bash_profile. If you want to use multiple shells but also use bash-only features, put the common stuff in .profile and the bash-only stuff in .bash_profile, then add if [ -f ~/.profile ]; then . ~/.profile; fi to .bash_profile.

    If you only ever use bash, but don’t rely on any bash-only features in your profile, then it doesn’t really matter.

    There’s actually another complication: login bash shells source either .bash_profile, .bash_login, or .profile; non-login interactive bash shells (e.g. subshells) source .bashrc instead. I tend to want the same setup in both login and non-login shells, so I put all the interesting stuff in .bashrc, and then if [ -f ~/.bashrc ]; then . ~/.bashrc; fi in .bash_profile. If I also used other shells, I’d probably put most of it in .profile instead, and have .bashrc source that instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'been doing some inheritance in js in order to understand it better, and I
I understand that some countries have laws regarding website accessibility. In general, what are
I understand that there are several ways to blend XNA and WPF within the
I have a code that creates file(s) in user-specified directory. User can point to
I have a file, which is in XML format (consists just of root start
I now understand that a clustered index contains all of the row data, not
Trying to understand the Android framework model. I have an application that needs to
I found the following bash script in order to monitor cp progress. #!/bin/sh cp_p()
I understand how I can change the dns settings for my domains by editing
I understand what System.WeakReference does, but what I can't seem to grasp is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.