我在 OSX 上,我需要在配置文件中添加类似 alias blah="/usr/bin/blah" 的内容,但我不知道配置文件在哪里.
I'm on OSX and I need to put something like this, alias blah="/usr/bin/blah" in a config file but I don't know where the config file is.
推荐答案您可以在启动脚本文件中添加 alias 或 function.通常这是您的主目录中的 .bashrc、.bash_login 或 .profile 文件.
You can add an alias or a function in your startup script file. Usually this is .bashrc, .bash_login or .profile file in your home directory.
由于这些文件是隐藏的,因此您必须执行 ls -a 来列出它们.如果你没有,你可以创建一个.
Since these files are hidden you will have to do an ls -a to list them. If you don't have one you can create one.
如果我没记错的话,当我购买 Mac 时,.bash_login 文件并不存在.我必须为自己创建它,以便我可以将 prompt info、alias、functions 等放入其中.
If I remember correctly, when I had bought my Mac, the .bash_login file wasn't there. I had to create it for myself so that I could put prompt info, alias, functions, etc. in it.
如果您想创建一个,请执行以下步骤:
Here are the steps if you would like to create one:
更多推荐
如何创建 Bash 别名?
发布评论