Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way I can set up some shortcuts to my most used directories?

I mean "cd trunk" would always get me to my trunk location (e:\projects\work.....) from any place ?

share|improve this question
add comment

2 Answers

The details on your environment are very sparse, but if you use Bash or equivalent (e.g. through Cygwin), you can set CDPATH for this functionality.

Demonstrated:

~$ cd trunk
bash: cd: trunk: No such file or directory
~$ CDPATH="/projects/work"
~$ cd trunk
/projects/work/trunk
/projects/work/trunk$
share|improve this answer
add comment

I believe you are not looking for a "shortcut" but a command alias.

This post on The UNIX and Linux Forums explains how to use doskey if you have the appropriate version of Windows (which I assume you're using based on the path specified.

In Linux you can use the command alias to create e.g. cdt to expand to cd ~/projects/trunk. Cygwin and similar environments on Windows can do the same.

tip: for future posts please specify the OS you're on and if relevant the shell used. Are you using plain DOS, cygwin, etc.?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.