2

I am using Linux Mint 16 with xfce and I have the following problem:

For my work I always have to switch to a long path in my File system.
I tried to avoid this by adding this one particular folder to my CDPATH.
I added the path with:

export CDPATH=$CDPATH:/directory/to/add

But this only works for one terminal session. After closing the terminal, the CDPATH is gone again.
I have read to put the given line for exporting into my .bashrc or my .profile or some other files, but none of them worked permanently.

So, how can I add a directory to my CDPATH permanently ?
Maybe with a bash Script in my autostart ?

Naturjoghurt
  • 541
  • 6
  • 21

1 Answers1

5

Add it in ~/.bash_profile, if you want to use it in a non-login session then add it in ~/.bashrc

Here is a explanation for the difference between them.

Community
  • 1
  • 1
WKPlus
  • 6,955
  • 2
  • 35
  • 53
  • Thank you. I do not know, why this did not work the first time, but now anything works. I will close accept and close this as soon as I can. – Naturjoghurt Jun 19 '14 at 11:30
  • 1
    You can run `source ~/.bash_profile` to make this take effect in sessions opened before you add the configuration. – WKPlus Jun 19 '14 at 11:32