0

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 ?

2 Answers 2

3

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.?

0

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$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .