0

I used to be able to cd into aliases with my Mac. Today I was messing around with ~/.bashrc and ~/.bash_profile to make PostgreSQL work. After I restarted my computer it stopped cd'ing to aliases and after some research I figured I was not supposed to be able to do that from the beginning.

So I do not know how I was able to cd into aliases before or how I broke it (maybe a system update became valid after restart, I wasn't restarting for a while). I have only found the following answer on couple places How to go to alias from terminal?.

I am looking for an explanation to what happened and a simple way of fixing it rather than modifying cd function itself. I do not prefer creating a symbolic link because it would be broken when I make a change in the actual file & I have many aliases to replace so it seems like a redundant work.

Note: Im still not able to cd into aliases when I undo the changes I made in ~/.bashrc and ~/.bash_profile, so this seems to be caused by something else or my changes triggered something once and it was enough for a permanent change.

ozgeneral
  • 160
  • The link indeed provided me an insight, its almost the same question. But that still does not explain the mystery here. I am curious why I used to be able to do cd into aliases and how I lost it... Maybe OS X somehow created hard links instead of aliases and remembered to correct this somehow, Idk... – ozgeneral Jul 20 '16 at 14:04
  • They may have been hard links to begin with or they got converted. You shouldn't have been able to cd into an alias within Terminal. – Allan Jul 20 '16 at 14:09
  • I am pretty sure I created them by "right click > create alias", but lets say that created an hard link instead due to a system error. Then how I accidentally converted them into aliases, or can a restart have such an effect? If we understand the cause, maybe it could be possible to convert all aliases back to hard links? – ozgeneral Jul 20 '16 at 14:12
  • I don't know how you could have traversed into an alias from Terminal to begin with because this behavior is by design. Aliases are files as are hard links. You can't cd into an alias, but you can cd into a hard link. Maybe they were hard links to begin with? – Allan Jul 20 '16 at 14:16

0 Answers0