Add a path in $PATH globally for every user












17















Do we have anyway to add a path globally so that each user gets it in $PATH. I want to add path of ANT so that each user doesn't need to add it in his $PATH variable.










share|improve this question


















  • 1





    If you intend users to run a particular shell, say bash, then you could add the export line in /etc/bashrc as it will be read systemwide.

    – mkc
    Dec 11 '13 at 16:54
















17















Do we have anyway to add a path globally so that each user gets it in $PATH. I want to add path of ANT so that each user doesn't need to add it in his $PATH variable.










share|improve this question


















  • 1





    If you intend users to run a particular shell, say bash, then you could add the export line in /etc/bashrc as it will be read systemwide.

    – mkc
    Dec 11 '13 at 16:54














17












17








17


5






Do we have anyway to add a path globally so that each user gets it in $PATH. I want to add path of ANT so that each user doesn't need to add it in his $PATH variable.










share|improve this question














Do we have anyway to add a path globally so that each user gets it in $PATH. I want to add path of ANT so that each user doesn't need to add it in his $PATH variable.







path aix






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 11 '13 at 16:53









AhmadAhmad

212137




212137








  • 1





    If you intend users to run a particular shell, say bash, then you could add the export line in /etc/bashrc as it will be read systemwide.

    – mkc
    Dec 11 '13 at 16:54














  • 1





    If you intend users to run a particular shell, say bash, then you could add the export line in /etc/bashrc as it will be read systemwide.

    – mkc
    Dec 11 '13 at 16:54








1




1





If you intend users to run a particular shell, say bash, then you could add the export line in /etc/bashrc as it will be read systemwide.

– mkc
Dec 11 '13 at 16:54





If you intend users to run a particular shell, say bash, then you could add the export line in /etc/bashrc as it will be read systemwide.

– mkc
Dec 11 '13 at 16:54










3 Answers
3






active

oldest

votes


















19














Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:



PATH=$PATH:/path/to/ANT/bin





share|improve this answer































    6














    Many Linux distributions support the Linux Standard Base /etc/profile.d directory where configurations such as additional paths directives can go without touching the stock system files. The file name just needs an .sh extension.



    For example



    cat >> /etc/profile.d/some_name.sh << EOF
    PATH=$PATH:/path/to/ANT/bin
    EOF





    share|improve this answer



















    • 3





      The OP tagged it [AIX], though...

      – Jeff Schaller
      Feb 22 '16 at 21:26



















    -1














    Edit /etc/profile and update the Path manipulation section. Centos does not include the /usr/local/bin in the path.



    # Path manipulation
    if [ "$EUID" = "0" ]; then
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
    pathmunge /usr/local/bin
    else
    pathmunge /usr/local/bin after
    pathmunge /usr/local/sbin after
    pathmunge /usr/sbin after
    fi





    share|improve this answer








    New contributor




    cwill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.
















    • 1





      It looks like your code assumes bash is being used. Also, notice the aix tag on the question. This user is not using CentOS.

      – Kusalananda
      6 hours ago











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f104727%2fadd-a-path-in-path-globally-for-every-user%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    19














    Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:



    PATH=$PATH:/path/to/ANT/bin





    share|improve this answer




























      19














      Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:



      PATH=$PATH:/path/to/ANT/bin





      share|improve this answer


























        19












        19








        19







        Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:



        PATH=$PATH:/path/to/ANT/bin





        share|improve this answer













        Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:



        PATH=$PATH:/path/to/ANT/bin






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 11 '13 at 16:56









        terdonterdon

        132k32262441




        132k32262441

























            6














            Many Linux distributions support the Linux Standard Base /etc/profile.d directory where configurations such as additional paths directives can go without touching the stock system files. The file name just needs an .sh extension.



            For example



            cat >> /etc/profile.d/some_name.sh << EOF
            PATH=$PATH:/path/to/ANT/bin
            EOF





            share|improve this answer



















            • 3





              The OP tagged it [AIX], though...

              – Jeff Schaller
              Feb 22 '16 at 21:26
















            6














            Many Linux distributions support the Linux Standard Base /etc/profile.d directory where configurations such as additional paths directives can go without touching the stock system files. The file name just needs an .sh extension.



            For example



            cat >> /etc/profile.d/some_name.sh << EOF
            PATH=$PATH:/path/to/ANT/bin
            EOF





            share|improve this answer



















            • 3





              The OP tagged it [AIX], though...

              – Jeff Schaller
              Feb 22 '16 at 21:26














            6












            6








            6







            Many Linux distributions support the Linux Standard Base /etc/profile.d directory where configurations such as additional paths directives can go without touching the stock system files. The file name just needs an .sh extension.



            For example



            cat >> /etc/profile.d/some_name.sh << EOF
            PATH=$PATH:/path/to/ANT/bin
            EOF





            share|improve this answer













            Many Linux distributions support the Linux Standard Base /etc/profile.d directory where configurations such as additional paths directives can go without touching the stock system files. The file name just needs an .sh extension.



            For example



            cat >> /etc/profile.d/some_name.sh << EOF
            PATH=$PATH:/path/to/ANT/bin
            EOF






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 22 '16 at 21:07









            NoelProfNoelProf

            40944




            40944








            • 3





              The OP tagged it [AIX], though...

              – Jeff Schaller
              Feb 22 '16 at 21:26














            • 3





              The OP tagged it [AIX], though...

              – Jeff Schaller
              Feb 22 '16 at 21:26








            3




            3





            The OP tagged it [AIX], though...

            – Jeff Schaller
            Feb 22 '16 at 21:26





            The OP tagged it [AIX], though...

            – Jeff Schaller
            Feb 22 '16 at 21:26











            -1














            Edit /etc/profile and update the Path manipulation section. Centos does not include the /usr/local/bin in the path.



            # Path manipulation
            if [ "$EUID" = "0" ]; then
            pathmunge /usr/sbin
            pathmunge /usr/local/sbin
            pathmunge /usr/local/bin
            else
            pathmunge /usr/local/bin after
            pathmunge /usr/local/sbin after
            pathmunge /usr/sbin after
            fi





            share|improve this answer








            New contributor




            cwill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.
















            • 1





              It looks like your code assumes bash is being used. Also, notice the aix tag on the question. This user is not using CentOS.

              – Kusalananda
              6 hours ago
















            -1














            Edit /etc/profile and update the Path manipulation section. Centos does not include the /usr/local/bin in the path.



            # Path manipulation
            if [ "$EUID" = "0" ]; then
            pathmunge /usr/sbin
            pathmunge /usr/local/sbin
            pathmunge /usr/local/bin
            else
            pathmunge /usr/local/bin after
            pathmunge /usr/local/sbin after
            pathmunge /usr/sbin after
            fi





            share|improve this answer








            New contributor




            cwill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.
















            • 1





              It looks like your code assumes bash is being used. Also, notice the aix tag on the question. This user is not using CentOS.

              – Kusalananda
              6 hours ago














            -1












            -1








            -1







            Edit /etc/profile and update the Path manipulation section. Centos does not include the /usr/local/bin in the path.



            # Path manipulation
            if [ "$EUID" = "0" ]; then
            pathmunge /usr/sbin
            pathmunge /usr/local/sbin
            pathmunge /usr/local/bin
            else
            pathmunge /usr/local/bin after
            pathmunge /usr/local/sbin after
            pathmunge /usr/sbin after
            fi





            share|improve this answer








            New contributor




            cwill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.










            Edit /etc/profile and update the Path manipulation section. Centos does not include the /usr/local/bin in the path.



            # Path manipulation
            if [ "$EUID" = "0" ]; then
            pathmunge /usr/sbin
            pathmunge /usr/local/sbin
            pathmunge /usr/local/bin
            else
            pathmunge /usr/local/bin after
            pathmunge /usr/local/sbin after
            pathmunge /usr/sbin after
            fi






            share|improve this answer








            New contributor




            cwill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer






            New contributor




            cwill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered 6 hours ago









            cwillcwill

            1




            1




            New contributor




            cwill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            cwill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            cwill is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.








            • 1





              It looks like your code assumes bash is being used. Also, notice the aix tag on the question. This user is not using CentOS.

              – Kusalananda
              6 hours ago














            • 1





              It looks like your code assumes bash is being used. Also, notice the aix tag on the question. This user is not using CentOS.

              – Kusalananda
              6 hours ago








            1




            1





            It looks like your code assumes bash is being used. Also, notice the aix tag on the question. This user is not using CentOS.

            – Kusalananda
            6 hours ago





            It looks like your code assumes bash is being used. Also, notice the aix tag on the question. This user is not using CentOS.

            – Kusalananda
            6 hours ago


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f104727%2fadd-a-path-in-path-globally-for-every-user%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Entries order in /etc/network/interfaces

            新発田市

            Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)