Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think that the problem comes from the fact you override the PATH
environment variable. As a result, when you try to use 'env' command,
the shell does not know where it is.
Furthermore, take in mind that if you export a variable from the command line, it will be available to the open shell only (that is if you open another terminal you start a new shell which will not be aware of the modified environment). To make your changes really global, you have to put the export statement in a file which will be sourced every time you start a new shell (usually .bashrc if using bash).
colucix, lbdgwgt & kWzTa Thank you guys you were helpfull, but i found that my setting are not global. which bashrc file i should modify with export statement? & what line should change?
If you want to define environment variables on a per-user basis, you should put export statements in .bashrc under user's home (e.g. /home/Mubarak/.bashrc from your list). If you want a system wide configuration, the better place is under the /etc/profile.d directory. Look at its content: you will find some .sh and .csh scripts. These contain environment settings from specific applications. You can create your own, for example a script called ns.sh.
Just for completeness, these scripts are sourced from /etc/profile, which - on my system - has the following relevant piece of code:
Code:
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.