PDA

View Full Version : Missing .bash_profile file



kpfuser
10-28-2007, 04:44 PM
While trying to learn how to use the bash shell, I was asked on two different occasions to edit the .bash_profile file purportedly located in my home directory. Unfortunately neither the ls -a command nor a search via the Find applet were able to locate it. Is this file part of Knoppix and if so where/how can I locate it? If not, there must be a similar file that serves in the same manner as the missing one. Which one? Btw, what I wanted to do with it was to enter (1) an alias and (2) a path to a file containing my scripts so that the latter can be executed from any directory without the need to navigate to the directory that contains them first.

wbatw
10-31-2007, 11:46 PM
You can just create one, and put your commands in it.

Many linux systems will fall back to /etc/bash_profile (note no dot) if it is there, but I don't see one on the image I am using.

google would get you lots of info on this - it is a very general linux question

kpfuser
11-01-2007, 02:12 PM
Thanks! I will keep this in mind. Meanwhile, I found that the .bashrc file (which is the home directory) can do exactly what I wanted to get out of the missing .bash_profile file. Thanks again!

maxIT
11-03-2007, 07:18 PM
I think is necessary to clear something confusing here, knowing for what .bash_profile and .bashrc are in place:
.bash_profile is loaded on login shells (those that you go in loading the system in text-only mode or throught 'ctrl-alt-fx')
.bashrc came in place on non-login shells (such as xterm, konsole etc.)
In my knoppix .bash_profile doesn't exist by default.



Many linux systems will fall back to /etc/bash_profile (note no dot) if it is there, but I don't see one on the image I am using. :!:

Maybe you are talking about /etc/profile.
Both .bashrc and .bash_profile residing in the home directory are strictly user-related. '/etc/profile' instead affect all the system, so what you put in it take effect even on root-user and all other users.