开发者

Faster use of the cli - setting a variable for current project

I'm frequently using the cli (terminal) on Linux and Mac.

How can I save time by setting a variable to the current project folder instead of

开发者_StackOverflow cd path/to/folder/over/and/over/again

Something like

cd the-current-project

(with tab completion) ?


Depending on your shell, you can set a cdpath with directories you regularly cd to, and so you can do just what you want:

cd the-current-project

from anywhere. See here for more details.

Alternatively you can just set a shell variable and

cd $CURRENT_PROJECT

Again, your shell will determine whether you can tab-complete this (I know zsh will do this. I'm not sure about bash).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜