Possible Duplicate:
How do I set a user environment variable? (permanently, not session)

How can I permanently modify the PATH variable in Ubuntu? Is it possible to do it without modifying any files?

I currently use export PATH=${PATH}:/usr/local/cuda/bin but each time I open a new terminal I have to type it again.


Your PATH comes from a text file (usually ~/.bash_profile). There really isn't a way to edit it without changing your profile short of doming something like

echo 'PATH=$PATH:/usr/local/cuda/bin' >> ~/.bash_profile

Usually I just throw that exact command you have in my ~/.bash_profile.


put this line into you .bashrc or .profile file in ~/ Then it is loaded whenever you start your console session


You can't do it with just a command.

You have to edit the bashrc file for either the system installation or your personal one for permanent changes to take effect.