0

I have an alias earlier to start old pycharm version. Now I have downloaded the new version and would like to start the new one. The earlier alias is kept coming even after I removed the old alias in .bash_profile and rebooted my system.

$ pycharm-start

bash: /home/bharath/Downloads/pycharm-**2019.2.3**/bin/pycharm.sh: No such file or directory

$grep pycharm-start .bash_profile

alias pycharm-start='/home/bharath/Downloads/pycharm-**2020.2**/bin/pycharm.sh'

$reboot

$ pycharm-start

bash: /home/bharath/Downloads/pycharm-2019.2.3/bin/pycharm.sh: No such file or directory

If I source the .bash_profile then it will take the new alias. Please let me know what I am missing here?

Regards, Bharath

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
  • `.bash_profile` is only used for the login shell, not for every interactive shell. – Charles Duffy Sep 18 '20 at 14:35
  • 1
    Use `.bashrc` instead for aliases. – Charles Duffy Sep 18 '20 at 14:35
  • (...that said, in general, you should consider not using aliases at all; functions are far more flexible as an alternative). – Charles Duffy Sep 18 '20 at 14:36
  • Also, general how-do-I-use-my-shell questions are better fit for [unix.se] or [SuperUser](https://superuser.com/), rather than Stack Overflow. You'll note the duplicate I closed this with is very old -- part of why that's the case is that we've gotten more narrowly focused on software-development questions over time, letting other parts of the Stack Exchange network take up other topics. – Charles Duffy Sep 18 '20 at 14:36
  • Beyond that, I'd suggest `PS4=':$BASH_SOURCE:$LINENO+' bash -x -l -i` to create a new shell instance that logs every command it runs with the filename and line number that log came from; you can read that log to see where any old/undesired alias definition comes from. – Charles Duffy Sep 18 '20 at 14:39

0 Answers0