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.
相关问题
- How to get the return code of a shell script in lu
- JQ: Select when attribute value exists in a bash a
- Invoking Mirth Connect CLI with Powershell script
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
相关文章
- 使用2台跳板机的情况下如何使用scp传文件
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- In IntelliJ IDEA, how can I create a key binding t
- Check if directory exists on remote machine with s
- shell中反引号 `` 赋值变量问题
- How get the time in milliseconds in FreeBSD?
- xcode 4 garbage collection removed?
On OS X you want to use ~/.bash_profile. This is because by default Terminal.app opens a login shell for each new window.
See more about the different configuration files and when they are used here: What's the difference between .bashrc, .bash_profile, and .environment?
and in relation to OSX here: About .bash_profile, .bashrc, and where should alias be written in?
If you put
blah="/usr/bin/blah"
in your~/.bashrc
then you can use$blah
in your login shell as a substitute for typing/usr/bin/blah
I just open zshrc with sublime, and edit it.
And add this on sublime:
Run this in terminal:
Done.
In my
.bashrc
file the following lines were there by default:Hence, in my platform
.bash_aliases
is the file used for aliases by default (and the one I use). I'm not an OS X user, but I guess that if you open your.bashrc
file, you'll be able to identify what's the file commonly used for aliases in your platform.Add the following like:
Finally restart Terminal.
You probably want to edit the
.bashrc
file in your home directory.