如果.bash_profile不存在,如何设置.我想从Mac的命令行启动Sublime [英] How to set .bash_profile, if it does not exist yet. I want to launch sublime from a command line in Mac
本文介绍了如果.bash_profile不存在,如何设置.我想从Mac的命令行启动Sublime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用subl filename
从Mac的命令行启动sublime.它似乎涉及处理.bash_profile
.但是我没有找到文件.应该采取什么步骤?
I want to launch sublime from a command line in Mac, using subl filename
. It seems to involve dealing with .bash_profile
. But I didn't locate the file. What steps to be taken?
推荐答案
典型的OS X安装不会为您创建.bash_profile
.当您想从命令行运行函数时,这是必须具备的.
A typical install of OS X won't create a .bash_profile
for you. When you want to run functions from your command line, this is a must-have.
- 启动终端
- 键入
cd ~/
转到主文件夹 - 键入
touch .bash_profile
创建新文件. - 使用您喜欢的编辑器编辑
.bash_profile
(或者您只需键入open -e .bash_profile
即可在TextEdit中打开它. - 键入
. .bash_profile
以重新加载.bash_profile
并更新您添加的所有功能.注意两个点之间的间隔!
- Start up Terminal
- Type
cd ~/
to go to your home folder - Type
touch .bash_profile
to create your new file. - Edit
.bash_profile
with your favorite editor (or you can just typeopen -e .bash_profile
to open it in TextEdit. - Type
. .bash_profile
to reload.bash_profile
and update any functions you add. Notice the space between the two dots!
这篇关于如果.bash_profile不存在,如何设置.我想从Mac的命令行启动Sublime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文