9

I constantly need to type:

cd /home/geo/Geant4/geant4.10.00.p02-install/lib/Geant4-10.0.2

How do I create an alias to that directory, so I could just type:

cd $geant (or any other word I decide to create as the alias name)

It would also help me whenever I need to use cmake because I could use $geant as well in the middle of a cmake option.

Thanks.

Geo
  • 1,315

2 Answers2

9

Open your $HOME/.bashrc and append:

export GEANT=/home/geo/Geant4/geant4.10.00.p02-install/lib/Geant4-10.0.2

then run source ~/.bashrc and now you schould be able to use it like this:

cd $GEANT
TuKsn
  • 4,440
1

Just create a link in nautilus, and treat it as a normal folder. Terminal will go straight to it.

Tim
  • 33,500