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

前端 未结 7 531
迷失自我
迷失自我 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:36

    I am not sure how OSX exposes Alias links but since you are using bash you can just create a variable in your .bashrc file.

    On its own line put:

    htdocs=YourDirectoryPath/
    

    Once you have restarted bash you can just type cd $htdocs

提交回复
热议问题