Adding a directory to PATH in Ubuntu [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionI am a new user of Linux, just switched from Windows. I installed ActiveTcl-8.5 in /opt/ActiveTcl-8.5/
, now I want to add its bin
directory to the UNIX path.
I have read a number of articles from the net and got confused about which开发者_Python百科 file to modify. My /home/tofayel
directory contains .bashrc
, .bash_logout
, .bash_history
, and .profile
; but not .bash_login
and .bash_profile
.
Where do I add the extra lines to add /opt/ActiveTcl-8.5/bin
to PATH?
The file .bashrc
is read when you start an interactive shell. This is the file that you should update. E.g:
export PATH=$PATH:/opt/ActiveTcl-8.5/bin
Restart the shell for the changes to take effect or source it, i.e.:
source .bashrc
Actually I would advocate .profile
if you need it to work from scripts, and in particular, scripts run by /bin/sh instead of Bash. If this is just for your own private interactive use, .bashrc
is fine, though.
you can set it in .bashrc
PATH=$PATH:/opt/ActiveTcl-8.5/bin;export PATH;
精彩评论