Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
Normally, .profile is for ksh, .bash_xxx are for bash shell.
If you're login shell is bash (see /etc/passwd), move .profile to .bash_profile and logout and back in again.
You may(!) need to alter the contents slightly. ksh and bash are highly compatible, but not quite 100%.
Read though the beginning of the bash info manual. It details which startup scripts are run. ~/.profile, ~/.bash_profile & ~/.bash_login are login scripts. You only need one of them present, and the one checked for first will be the one run. Most distro's use ~/.profile. If you sometimes use ksh or csh as your default shell, then check that shells documentation to see if ~/.profile would be run. In that case, either generic code would need to be used, or you want to use ~/.bash_profile or ~/.bash_login, so that it runs instead when you use bash as your default shell.
Use the login scripts to add to your PATH variable. ~/.bashrc is the bash startup script. It is run when you startup a new subshell, such as opening konsole or xterm. You don't want an instruction like "PATH=$PATH:/usr/local/bin" because if you open up a new subshell, the same path will be added on again.
Also, ~/.bashrc isn't run when you log on, but the ~/.bash_login or the ~/.profile script may source ~/.bashrc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.