I\'m trying to write a small script to change the current directory to my project directory:
#!/bin/bash cd /home/tree/projects/java
I save
It is an old question, but I am really surprised I don't see this trick here
Instead of using cd you can use
export PWD=the/path/you/want
No need to create subshells or use aliases.
Note that it is your responsibility to make sure the/path/you/want exists.