I have some simple aliases in my .bash_profile
(OS X El Capitan, 10.11.6). Sometimes, I want multiple aliases that do the same thing. I have, for example, a folder that is my starting point for programming projects. Currently, I have an alias for code and one for programming that do the same thing:
alias code='cd /path/to/Programming/; clear; pwd; ls'
alias programming='cd /path/to/Programming/; clear; pwd; ls'
This saves me having to remember how I aliased this directory. Is there a way to set multiple aliases without having to repeat the command? In short, is there something like this?
alias code,programming='cd /path/to/Programming/; clear; pwd; ls'
In short, is there something like this?
alias code,programming='cd /path/to/Programming/; clear; pwd; ls'
Yes, brace expansion:
alias {code,programming}='cd /path/to/Programming/; clear; pwd; ls'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With