Linux - NewbieThis 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.
hi.. how do i add a path variable? my programs arent finding my java vm, but whenever i add a path, i lose all my other paths and my commands too. so when i echo $PATH all that comes up is the one i added with the export command and thats it, and bash commands dont work anymore.
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Thanked: 0
this has been covered extensively before in this thread...
put in your .bash_profile
export PATH=$PATH:/usr/local/java/jdsdkX.X.X/bin/
if you want to test in your session:
. ~/.bash_profile #source the config
otherwise close all your consoles and the path will now be present in them.
You can edit anything you want - but I guess with SuSE, if you break it, you get to keep the pieces. So, sure, create a user-specific file. That's what you should really do as a matter of course unless you specifically wish to alter system-wide defaults.
Distribution: RedHat 9.0 / Slackware 9.0/ FreeBSD 4.8 / Solaris 8 x86 / Mandrake 9.0
Posts: 90
Thanked: 0
Well that all depends on what shell you use as to whether you have a .bash_profile, I believe if you edit/create a ~/.profile that is the bourne(sh) default file so it should work for all bourne shells if they don't have their own specific profile. I hope you realize that you need to scan your home dir with ls -a to see the hidden files. From the sounds of it you probably have a ~/.profile instead of a .bash_profile you should have a ~./bashrc and a ~/.bash_history also. Anyway if you don't you can probably copy any files from /etc/skel and if all else fails read the manual for bash and consult the "files" section.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.