Add a path in $PATH globally for every user
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
add a comment |
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
1
If you intend users to run a particular shell, say bash, then you could add theexportline in/etc/bashrcas it will be read systemwide.
– mkc
Dec 11 '13 at 16:54
add a comment |
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
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
path aix
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 theexportline in/etc/bashrcas it will be read systemwide.
– mkc
Dec 11 '13 at 16:54
add a comment |
1
If you intend users to run a particular shell, say bash, then you could add theexportline in/etc/bashrcas 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
add a comment |
3 Answers
3
active
oldest
votes
Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:
PATH=$PATH:/path/to/ANT/bin
add a comment |
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
3
The OP tagged it [AIX], though...
– Jeff Schaller
Feb 22 '16 at 21:26
add a comment |
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
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 assumesbashis being used. Also, notice the aix tag on the question. This user is not using CentOS.
– Kusalananda
6 hours ago
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:
PATH=$PATH:/path/to/ANT/bin
add a comment |
Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:
PATH=$PATH:/path/to/ANT/bin
add a comment |
Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:
PATH=$PATH:/path/to/ANT/bin
Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile:
PATH=$PATH:/path/to/ANT/bin
answered Dec 11 '13 at 16:56
terdon♦terdon
132k32262441
132k32262441
add a comment |
add a comment |
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
3
The OP tagged it [AIX], though...
– Jeff Schaller
Feb 22 '16 at 21:26
add a comment |
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
3
The OP tagged it [AIX], though...
– Jeff Schaller
Feb 22 '16 at 21:26
add a comment |
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
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
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
add a comment |
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
add a comment |
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
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 assumesbashis being used. Also, notice the aix tag on the question. This user is not using CentOS.
– Kusalananda
6 hours ago
add a comment |
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
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 assumesbashis being used. Also, notice the aix tag on the question. This user is not using CentOS.
– Kusalananda
6 hours ago
add a comment |
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
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
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.
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 assumesbashis being used. Also, notice the aix tag on the question. This user is not using CentOS.
– Kusalananda
6 hours ago
add a comment |
1
It looks like your code assumesbashis 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
If you intend users to run a particular shell, say bash, then you could add the
exportline in/etc/bashrcas it will be read systemwide.– mkc
Dec 11 '13 at 16:54