Unix:将Export PATH导出到“Stick” [英] Unix: Getting Export PATH to "Stick"

查看:172
本文介绍了Unix:将Export PATH导出到“Stick”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  export PATH = $ PATH:$ EC2_HOME / bin 

如果我退出终端并将其打开以继续工作,我必须再次执行所有步骤,设置每次都会有路径。
我想知道如何设置路径并让它粘,所以我的系统知道在下一次打开终端的时候找到所有的东西,而不必再做一遍。
谢谢!

解决方案

打开〜/ .bashrc。每当你启动一个新的shell(如果你使用的是大多数人的Bash),这个文件就被加载了。如果您使用的是不同的外壳,该文件可能会有不同的名称,例如〜/ .shrc



将需要的行添加到文件的底部:

  export PATH = $ PATH:$ EC2_HOME / bi 

其他信息从线程中的其他地方卷起:



有多个地方要放这个,这取决于你的外壳和你的需要。所有这些文件都在您的主目录中:



对于Bash:

  .bashrc(当你打开一个shell时执行)

  .bash_profile(当您登录时执行)

对于csh和tcsh:

  .cshrc 

对于sh和ksh:

  .profile 


When setting the export path in Unix, example:

export PATH=$PATH: $EC2_HOME/bin

If I quit terminal and open it back up to continue working, I have to go through all the steps again, setting up the paths each time. I'm wondering how I can set the path and have it "stick" so my system knows where to find everything the next time I open terminal without having to do it all over again. Thanks!

解决方案

Open ~/.bashrc. This file is loaded every time you start up a new shell (if you're using Bash, which most people are). If you're using a different shell, the file may have a different name, like ~/.shrc.

Add the line you need to the bottom of the file:

export PATH=$PATH:$EC2_HOME/bi

Other info rolled up from elsewhere in the thread:

There are multiple places to put this, depending on your shell and your needs. All of these files are in your home directory:

For Bash:

.bashrc (executed when you shart a shell)

OR

.bash_profile (executed when you log in)

For csh and tcsh:

.cshrc

For sh and ksh:

.profile

这篇关于Unix:将Export PATH导出到“Stick”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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