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
You need no script, only set the correct option and create an environment variable.
shopt -s cdable_vars
in your ~/.bashrc
allows to cd
to the content of environment variables.
Create such an environment variable:
export myjava="/home/tree/projects/java"
and you can use:
cd myjava
Other alternatives.