Since These files is hidden you'll have the to do a to ls -a
list them. If you don't have one, you can create one.
Update:
If I remember correctly, when I had bought my Mac, .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 is the steps if you would like to create one-
- Start up Terminal
- Type to
cd ~/
go to your home folder
- Type to
touch .bash_profile
Create your new file.
- Edit with
.bash_profile
your favorite editor (or you can just type to open -e .bash_profile
open it in TextEdit.
- Type to
. .bash_profile
reload and update any alias you .bash_profile
Add.
Another covenient:
The config file for scripts and programs are and the ~/.bashrc
config file that gets loaded if you use Terminal is ~/.bash_login
.
I think the best just has everything in ~/.bashrc
.
For your specific question just enter (this would overwrite any existing ~/.BASHRC):
echo "alias blah=\"/usr/bin/blah\"" >~/.bashrc
Into the Terminal and a ~/.bashrc
file is created with your new alises. After this just edit the file to add new aliases, functions, settings etc.
How to add alias on Mac (It's common for most system)