How to create a bash alias on OS X?
Solution 1:
I've found that I can do this by editing the .bash_profile
file.
Just added:
alias my_alias='cd /my/really/long/long/path
to .bash_profile
, and after reopening bash my alias command worked just fine.
Solution 2:
nano ~/.bash_profile
alias my_alias= 'ssh [email protected]'
- ctrl + x , then press y and enter to save.
-
Don't forget to reload the file with:
source ~/.bash_profile
or . ~/.bash_profile Then test the alias.