Results 1 to 6 of 6

Thread: Is there a complete list of bash startup files and the order of their invocation?

  1. #1
    Join Date
    Jan 2018
    Location
    Annandale, VA
    Posts
    105

    Default Is there a complete list of bash startup files and the order of their invocation?

    I've seen several web pages listing bash startup files in /etc and the home directory, each missing files that are mentioned elsewhere, e.g., /etc/bash_bashrc. Is there a document that lists all of the startup files and explains thir relations to each other? In particular, which profile should I use for system-wide environment variables and which for a specific user's environment variables? Thanks.

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,916
    Blog Entries
    2

    Default Re: Is there a complete list of bash startup files and the order of their invocation?

    I doubt that there is anything like what you're asking for...
    I don't usually see binaries (executables) in /etc, I usually see only configuration files which are used by binaries.

    As for
    bashrc is typically modified with settings for the logged in User. There may be system-wide bashrc methods but I rarely see it.
    System-wide environmental modifications are related to /etc/profile but if you open that file you'll see a warning about making changes directly to that file, an upgrade or update will likely replace that file erasing your customizations. Instead, you're supposed to place your customizations in an /etc/profile.local file or create a file to be placed in the directory /etc/profile.d/

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3
    Join Date
    Jan 2018
    Location
    Annandale, VA
    Posts
    105

    Default Re: Is there a complete list of bash startup files and the order of their invocation?

    Creating a file in /etc/profile.d/ to set variables is probably my best bet. What about the various files in the home directory, e.g., ~/bash_profile, ~/.bashrc? Again, some sources mention names missing from others. Where is the best place to set environment variables specific to one user?

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,851

    Default Re: Is there a complete list of bash startup files and the order of their invocation?

    Try the man page!

    IMHO it does describe it in the section INVOCATION.
    Henk van Velden

  5. #5
    Join Date
    Oct 2011
    Location
    Germany (Ore Mountains)
    Posts
    427

    Default Re: Is there a complete list of bash startup files and the order of their invocation?

    If you want to set variables for single users, do so in the .bashrc or .profile in the users home directory. For all users in /etc.
    profile is for login shells, bashrc for non-login shells.

    On servers I usually put such things in ~/.profile.

  6. #6
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    885

    Default Re: Is there a complete list of bash startup files and the order of their invocation?

    Quote Originally Posted by shmuelmetz View Post
    I've seen several web pages listing bash startup files in /etc and the home directory, each missing files that are mentioned elsewhere, e.g., /etc/bash_bashrc. Is there a document that lists all of the startup files and explains thir relations to each other?
    https://www.gnu.org/software/bash/ma...tup-Files.html


    In particular, which profile should I use for system-wide environment variables and which for a specific user's environment variables? Thanks.
    http://www.linuxfromscratch.org/blfs...s/profile.html
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), openSUSE Tumbleweed, KDE Plasma 5

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •