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.
Hi All,
This may be very basic but still want to know how does this work.My requirement is to add a directory say /home/abc to my PATH variable for user xyz.Now I have read on the internet that the best way is to edit the .bash_profile file for the same.I am using ksh but.So the question is do I have to add multiple .*sh_profile files if I am using multiple shells.Also to have the same PATH work for all the shells do I have to add the PATH variable in all the profile files.Also my basic question to add the directory to the path variable.Do I have to add the following entry in the profile file
ksh is Korn shell so it relies on .profile not .bash_profile or .bashrc which are designed for bash (Borne Again Shell) which can also use .profile. csh (C shell) instead relies on .tcshrc. Each shell may have its own files so it is best to review the man page for the shell you intend to use. (i.e. type "man ksh" for manual page about ksh.)
Note that dot files such as .profile and .bash_profile are in the user's home directory so are unique to each user. If you want do environmental settings/variables for all users using a given shell then you'd edit files in /etc (e.g. /etc/profile for ksh and bash or /etc/csh.cshrc for csh)
Yes adding the PATH as you have it should work. Note that order of directories in PATH variable is important. If for example you had a program with the same name but different functions in each of /bin, /usr/bin and /data/myscripts and echo $PATH displayed:
/bin:/usr/bin:/data/myscripts
It would always run the one in /bin as that was first in your PATH. On the other hand if you had:
/usr/bin:/bin:/data/myscripts
It would always run the one in /usr/bin first.
Usually the above isn't an issue but you need to be aware of it. For example many DB products provide "isql" so it would be important that a DB user for one DB type use the isql provided by that product rather than one for another if you happened to be running more than one DB type on the same server.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.