在 Ubuntu 中将目录添加到 PATH [英] Adding a directory to PATH in Ubuntu

查看:61
本文介绍了在 Ubuntu 中将目录添加到 PATH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Linux 的新用户,刚从 Windows 切换过来.我在 /opt/ActiveTcl-8.5/ 中安装了 ActiveTcl-8.5,现在我想将它的 bin 目录添加到 UNIX 路径中.

I 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.

我从网上阅读了许多文章,但对要修改哪个文件感到困惑.我的 /home/tofayel 目录包含 .bashrc.bash_logout.bash_history.profile;但不是 .bash_login.bash_profile.

I have read a number of articles from the net and got confused about which file to modify. My /home/tofayel directory contains .bashrc, .bash_logout, .bash_history, and .profile; but not .bash_login and .bash_profile.

在哪里添加额外的行以将 /opt/ActiveTcl-8.5/bin 添加到 PATH?

Where do I add the extra lines to add /opt/ActiveTcl-8.5/bin to PATH?

推荐答案

文件 .bashrc 在您启动交互式 shell 时被读取.这是您应该更新的文件.例如:

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

这篇关于在 Ubuntu 中将目录添加到 PATH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆