在Mac上编辑PATH变量 [英] editing PATH variable on mac

查看:116
本文介绍了在Mac上编辑PATH变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Mac(Lion)上编辑PATH变量.我找不到可以添加路径的任何文件.有人可以指导我吗?

How to edit PATH variable on mac (Lion). I cannot find any file where I can add paths. can someone guide me about it?

文件名是什么? .profile或.bash_profile ???

Whats the file name? .profile or .bash_profile???

在哪里可以找到它? 我尝试过

and where I can find it? I have tried

echo 'export PATH=/android-sdk/tools:$PATH' >> ~/.profile

推荐答案

编辑/etc/paths.然后关闭终端,然后重新打开.

Edit /etc/paths. Then close the terminal and reopen it.

$ sudo vi /etc/paths

注意:每个条目都由换行符分隔.

Note: each entry is seperated by line breaks.

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

这篇关于在Mac上编辑PATH变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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