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

时间:2016-07-01 18:34:31

标签: linux bash shell ubuntu path

我有一个使用jmeter的脚本。现在,我不想在脚本中给出像sh /home/ubuntu/apache-jmeter-3.0/bin/jmeter.sh -n -t fileName.jmx这样的脚本中的路径,而只是想在脚本中给出sh jmeter.sh -n -t fileName.jmx。所以,我想在jmeter中设置ubuntu的路径。我不明白该怎么做。可以帮助一些人。

我的jmeter的路径是:/home/ubuntu/apache-jmeter-3.0

1 个答案:

答案 0 :(得分:0)

将目录/home/ubuntu/apache-jmeter-3.0/bin添加到您的路径:

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

然后你可以直接使用它:

jmeter.sh -n -t fileName.jmx

要将其永久化,请将新的PATH声明添加到~/.bashrc