Terminal – How to Create an Alias to a Directory

aliasdirectoryshortcuts

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 aswell in the middle of an cmake option

Thanks

Best Answer

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
Related Question