Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Dec 21 '11 at 20:59

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Michael Mrozek Dec 30 '11 at 21:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers 4

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
share|improve this answer

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

share|improve this answer

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

share|improve this answer

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.

share|improve this answer