mac 常用路径


默认的python库
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7

第三方安装的库
/Library/Python/2.7/site-packageshttp

apache 文件目录
/Library/WebServer/Documents/
配置文件 /etc/apache2/httpd.conf

启动mysql
sudo /usr/local/mysql/support-files/mysql.server start

脚本语言的第一行,指出该文件中的代码用什么可执行程序运行它

#!/usr/bin/python 告诉操作系统,运行该脚本时,调用/usr/bin/下面的python解释器
#!/usr/bin/env python 防止用户没有将python装在默认的/usr/bin/路径下。系统检测这一行,env在系统目录PATH中查找python安装路径

#!/usr/bin/python 相当于写死了路径

 

If you have several versions of Python installed, /usr/bin/env will ensure the interpreter used is the first one on your environment’s $PATH. The alternative would be to hardcode something like #!/usr/bin/python; that’s ok, but less flexible.

In Unix, an executable file that’s meant to be interpreted can indicate what interpreter to use by having a #! at the start of the first line, followed by the interpreter (and any flags it may need).

If you’re talking about other platforms, of course, this rule does not apply (but that “shebang line” does no harm, and will help if you ever copy that script to a platform with a Unix base, such as Linux, Mac, etc).

 

https://stackoverflow.com/questions/2429511/why-do-people-write-usr-bin-env-python-on-the-first-line-of-a-python-script#comment19984261_2429517

One thought on “mac 常用路径

发表评论

电子邮件地址不会被公开。 必填项已用*标注