Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I can't find .bash_profile in Ubuntu 14.04 in my /home/user directory. I use ls -a command to see the .bash_profile, but there isn't such a file.

share|improve this question
    
You should use ~/.profile instead. –  muru Aug 13 at 10:16
1  
possible duplicate of I can't find .bash_profile –  Alaa Ali Aug 13 at 10:21
1  
It's pretty common that some configuration file (or even directories) are missing. In that case the software that should read them will use a default configuration and/or read other sources to retrieve the configuration. If you want to modify a configuration file that doesn't exist simply create it first. –  Bakuriu Aug 13 at 11:33

3 Answers 3

up vote 2 down vote accepted

Ubuntu uses ~/.profile .

you can create your .bash_profile in Ubuntu but then .profile will not be read.

If we read .profile content :

cat ~/.profile

output

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.

So use ~/.profile instead of ~/.bash_profile

share|improve this answer

That means the file does not exist. But, you can create the file and bash executes/sources the file if bash is invoked as a login shell. So evertime you login via a shell (for example via ssh).

If you want the content to execute everytime you open a terminal, then you should modify the .bashrc file instead.

share|improve this answer
    
can you get some idea about why .bash_profile file is missing ? –  Selaru Sinbath Aug 13 at 10:18
    
You can copy it from /etc/skel/ directory. –  Frantique Aug 13 at 10:19
    
It's a design desicion of canonical. But, that does not mean cannot do it. –  chaos Aug 13 at 10:25

If you mean the .bashrc you will find it in your home folder. If it isn't there, you can copy it from the /etc/skel folder to your home folder.

If you need some more information on this subject, please visit stefaan lippens page.

http://stefaanlippens.net/bashrc_and_others

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.