To improve on the steps I have to take to complete some actions on my Mac, I have created many aliases. Example:
To open System Preferences, which I have to do often to manage multiple monitors, I have created the following alias in
~/.bash_profile
:alias pref='open -a System\ Preferences'
To put my setup in "Work From Home" mode, I have:
alias wfh='code&rdc&smc&'
which opens Visual Studio Code, the Remote Desktop and the Cisco Mobility Client.
To work with aliases themselves I have:
alias editbash='nano ~/.bash_profile;source ~/.bash_profile'
which opens the
~/.bash_profile
in nano editor and then when I'm done, it automatically sources the updated contents of the file for me.
Question:
I have numerous aliases that are all related to git. I often forget the alias for some actions. However, the good news is that all of my git aliases start with gt
.
How can I list only the aliases that start with a particular string?