After following thiscomment I added all my startup/alias commands to~/.bashrc file and in~/.bash_profile I addedsource ~/.bashrc
But still my aliases are not working. I have to manually source~/.bash_profile overtime (withsource ~/.bash_profile).
My .bashrc file:
alias km='cd /Users/apple/Desktop/km'and my .bash_profile file
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fisource ~/.bashrcIn my user directory I only have following files:
UPDATE:For me this solution actuallyworked
- is your terminal configured to launch alogin shell?glenn jackman– glenn jackman2015-12-29 18:15:02 +00:00CommentedDec 29, 2015 at 18:15
- Yes I guess its using login shell. Please check screenshot attached aboveNiraj Chauhan– Niraj Chauhan2015-12-30 04:57:17 +00:00CommentedDec 30, 2015 at 4:57
- Try running Terminal, the built in one not iTerm. Does it load your alias?Arc676– Arc6762015-12-30 10:00:40 +00:00CommentedDec 30, 2015 at 10:00
- no it didnt work :(Niraj Chauhan– Niraj Chauhan2015-12-30 11:13:47 +00:00CommentedDec 30, 2015 at 11:13
- If you solved your problem, please post an answer and accept it. Make sure you include proper acknowledgement of the original author, a link, and the most important information from said post. This helps future users by allowing them to easily see that the problem is solved even if they miss the last line.Arc676– Arc6762016-01-02 07:50:44 +00:00CommentedJan 2, 2016 at 7:50
2 Answers2
So after all struggle the only solution which worked for me is by executingsource ~/.bashrc every time when I open my terminal.
I've gotten it to work by using .login and .profile.The way it works is .login is sourced by every login shell and it in turn sources .profile
In .login I have:
. .profileand in .profile I have:
function pgrep(){ps -axww | grep -i "$1" | grep -v "[p ]grep"}function diskspc(){sudo find / -iname "*$1*" -print0 | xargs -0 du -chs}JAVA_HOME="/System/Library/Frameworks/JavaVM.Framework/Versions/1.5.0/Home"export JAVA_HOMEalias rsync="rsync --stats --progress"alias forcequit="open -a iForce\ Quit"alias ls="/bin/ls -FG"alias ll="ls -la"alias gls="gls --color=auto -aF"alias find="/usr/bin/find". /sw/bin/init.shLC_ALL='C'export LC_ALLalias locate2='if [ $((`date +%s`-`eval $(stat -s /var/db/locate.database); echo $st_mtime`)) -gt 3600 ]; then echo "locate: db is too old!">/dev/stderr; sudo /usr/libexec/locate.updatedb; fi; locate -i'alias flocate="/sw/bin/locate.fink --database=/sw/var/locatedb"LOCATE_PATH=/var/db/locate.database#LOCATE_PATH=/sw/var/locatedb:/var/db/locate.database#LOCATE_PATH=/sw/var/locatedbexport LOCATE_PATH#LESS_IS_MORE=1#export LESS_IS_MOREOf course,feel free to use or not the stuff in my .profile.
You mustlog in to answer this question.
Explore related questions
See similar questions with these tags.

