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

2020-05-11 09:22发布

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 the OS GUI -> rightclicked the htdocs directory and chose "Alias..." (i'm using a german OS if it's not alias maybe it's called shortcut in english?) then i moved it to my home directory (because my terminal starts from there when i open it).

All i want is to open my terminal and type "cd htdocs" so that i can work from there.

标签: macos bash
7条回答
可以哭但决不认输i
2楼-- · 2020-05-11 10:24

you can make symbolic link to it.

ln -s EXISTING_PATH LINK_NAME

e.g.

ln -s ~/Documents/books ~/Desktop/

Reference

Enter into a directory through an alias in Mac OS X terminal

查看更多
登录 后发表回答