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.
Hi i am looking for the ~./bash_profile in my suse 9 distro. I can;t find it. I want to add some commands to my profile file and command aliases..
Where is that file located?
You misplaced the dot before the filename. If it exists, it is in your home directory.
~/.bash_profile
The dot makes it hidden to the ls command unless you use the -a option.
In SuSE, in your home directory, there is a hidden file called .bashrc. That's the place to add commands and aliases for a user. If you want to make them available to all users, then add them to /etc/bash.bashrc. Just remember, any update to bash will overwrite /etc/bash.bashrc and you will have to do it again. The best way, add the commands/aliases to each user's ~/.bashrc.
There is a difference between .bashrc and .bash_profile.
.bash_profile is executed when you first log in.
.bashrc is executed everytime you open a new console using the bash shell.
If you want to add a directory to the PATH environment variable, do it in .bash_profile, so it isn't run more than once.
the .bash_profile and .bashrc are bash files, so it shouldn't matter which distro you are using. You can create one if you want to.
SUSE probably has startup files defined in the /etc directory for global bash setup, but leave it to you to make user changes in ~/.bash_profile and ~/.bashrc.
On my system, ~/.bash_rc just sources ~/.bashrc. I did add a line myself.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.