CDPATH - cd to your project directory from anywhere
I cross posted this tip to my own site: http://pempek.net/articles/2014/01/01/cdpath-cd-from-anywhere/
My projects are organized the following way:
~
├── ...
├── Projects
│ ├── Project1
│ ├── Project2
│ └── Project3
└── ...
In your ~/.bash_profile
, ~/.bashrc
or ~/.zshrc
just add:
CDPATH=.:~/Projects
Now enjoy being able to cd Project1
, cd Project2
or cd Project3
from anywhere:
$ cd /
$ cd Project1
$ pwd
/home/gregory/Projects/Project1
Written by Gregory Pakosz
Related protips
2 Responses
Does this have any negative side effects such as when names collide with files in your current directory?
over 1 year ago
·
Good point, I changed the tip so that .
is searched first
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#