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

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

    try:

    alias cdgo=`echo cd /root/go/`
    

    cdgo will run, then get command "cd /root/go/" and enter, and it will change your directory in current terminal process

    It works on my centos, no test with osx

提交回复
热议问题