Terminal window in Mac OS X

You can do this with shell profiles in Terminal.app.

  1. Select the Terminal menu, go to Preferenes.
  2. Select Settings from the buttons above.
  3. Either select an existing profile or create a new one
  4. In the Shell tab, check the Run Command box and enter cd $PROJECTDIR where $PROJECTDIR is the path to your project.
  5. Check Run inside shell

Now from the New Window or New Tab menu when you create a window or tab with the profile you modified, it will execute the cd command inside your bash shell and change your directory to the one you want.

This is handy because you can create many different profiles for different tasks. If you want to run a large number of commands when starting up a profile, put then in file in ~/bin/ or somewhere else in your home directory and execute those instead. You can also use the semicolon ; to run multiple commands if you've checked the Run inside shell checkbox.


You could create a symbolic link (which is like an alias in OS X, or shortcut in Windows) in your home directory, which is by default where your Terminal opens up.

Let's say your program source files are located in /usr/bin/myapps/. And your home directory is /users/Frank (you can reference your home directory by using the path /~ as well).

When you are in your home directory (/~), run the command

ln -s /usr/bin/myapps project

What this does is create a symbolic link called "project" to the location /usr/bin/myapps. You can then cd to project (cd /~/project) and wind up in /usr/bin/myapps.

This is the easiest fix, as it is temporary and can be removed easily. I believe you can just

rm /~/project

To delete the symlink.


You can use an alias in your ~/.profile:

alias mycode="cd /your/path/goes/here"

An alias can then be used just like any command. Type:

user@host ~: $ mycode

and you're there!

This way you don't have a softlink polluting your $HOME, and you can jump there anytime you like.


There's a similar question on Stack Overflow.

Open terminal here in Mac OS finder