How can I cd to an alias directory in the Mac OSX terminal

前端 未结 7 533
迷失自我
迷失自我 2021-01-29 23:49

Is there a way to get into an alias directory from shell with the command \"cd\" ? It always returns that \"htdocs\" isn\'t a directory.

Edit: I made the shortcut with t

7条回答
  •  无人共我
    2021-01-30 00:42

    I personally use this to quickly work in the directory which is present deep inside one of my Volumes in my Mac.

    Open your ~/.bash_profile, create an alias to the directory by adding this:

    alias cdh="cd /Volumes/Haiku/haiku/src/apps/superprefs"
    

    Save it, restart your terminal. Now on typing cdh in your terminal should change the working directory to the one mentioned as the alias.

提交回复
热议问题