Quickly jump to a project in shell
I have all my projects sitting under ~/projects/
directory. I work in console quite often and got tired of typing cd ~/projects/<project name>/
, so I wrote this tiny shell function that saves numerous keystrokes:
prj() { cd "$HOME/projects/${*}"; }
Usage:
prj awesome # changes directory to ~/projects/awesome
prj awesome/src # go straight to /src subdirectory of a project
prj hello world # correctly works with spaces in dir names
Just put the function definition into your ~/.bashrc
file.
P.S. Tested under bash but should work in most shells. You get the idea anyway :)
Written by Dmitry Pashkevich
Related protips
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#