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 want to put new aliases to my .bash_profile file, but I cannot find this file.
Where is it supposed to be?

share|improve this question
    
The title should probably read .bash_profile with the dot. –  broiyan Dec 11 '12 at 8:39
add comment

4 Answers

up vote 8 down vote accepted

It's a hidden file, located in your home folder:

~/.bash_profile

(the ~ expands to your home directory. If your username is user, the result would be: /home/user/.bash_profile).

Since it's an hidden file, you have to make it visible. To do it in Nautilus go to the "View" menu and check "Show hidden files" (or press the shortcut Ctrl + H).

If you are using Kubuntu with Dolphin, you have to press Ctrl + . to toggle the visibility of files.

share|improve this answer
2  
The Keys Ctrl-H toggles the show/hide hidden files also. –  Ice Mar 6 '11 at 17:15
    
sweet didn't know about that ctrl+H –  schwiz Mar 6 '11 at 23:58
add comment

~/.bash_profile is not the right place to put aliases and functions. They should go in ~/.bashrc. See http://mywiki.wooledge.org/DotFiles for an explanation.

share|improve this answer
add comment

It is handy to put all your alias in ~/.bash_aliases in the user home directory. That is what is suggested in the ~/.bashrc file in the comments.

share|improve this answer
add comment

just wanted to chime in - that even files are hidden in viewer you can still open all of them if you just enter name of the file. For example, if you write in dolphin address bar /home/<user>/.bashrc it will open the file with default editor without toggling show/hide some files.

Other way is to just open your favorite editor and just type in the name of file.

I see that as most preferred way to handle hidden files as showing not showing just add to noise that can be avoided.

And aliases should go into .bashrc as geirha wrote.

share|improve this answer
add comment

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.