简体   繁体   English

如何在ubuntu中的.profile或.bash_profile中设置PATH

[英]How to set the PATH in .profile or .bash_profile in ubuntu

I have a script which uses jmeter. 我有一个使用jmeter的脚本。 Now, instead of giving the path in the script like sh /home/ubuntu/apache-jmeter-3.0/bin/jmeter.sh -n -t fileName.jmx in the script I just want to give sh jmeter.sh -n -t fileName.jmx in the script. 现在,不要像脚本中的sh /home/ubuntu/apache-jmeter-3.0/bin/jmeter.sh -n -t fileName.jmx那样在脚本中给出路径,而只是想给sh jmeter.sh -n -t fileName.jmx脚本中的sh jmeter.sh -n -t fileName.jmx So, I want to set up the PATH of the jmeter in ubuntu . 所以,我想在ubuntu设置jmeter的PATH。 I didn't understand how to do it. 我不明白该怎么做。 Can some one help. 有人可以提供帮助。

Path to my jmeter is: /home/ubuntu/apache-jmeter-3.0 我的jmeter的路径是: /home/ubuntu/apache-jmeter-3.0

Add the directory /home/ubuntu/apache-jmeter-3.0/bin to your path: 将目录/home/ubuntu/apache-jmeter-3.0/bin添加到您的路径:

export PATH="$PATH":/home/ubuntu/apache-jmeter-3.0/bin

Then you can use it directly: 然后你可以直接使用它:

jmeter.sh -n -t fileName.jmx

To make it permanent, add the new PATH declaration to your ~/.bashrc . 要使其永久化,请将新的PATH声明添加到~/.bashrc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM