开发者

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

开发者 https://www.devze.com 2023-01-06 09:16 出处:网络
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

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

精彩评论

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