To alias a command in you ~/.zshrc
file, you can use the following syntax:
alias [alias-name]="[command-to-execute]"
For example, it is common to execute the command ls -a
. You can alias this command as la
as such:
alias la="ls -a"
After reloading the ~/.zshrc
file, you will be able to type la
and ls -a
will be executed.
It is common to have certain folders that you cd
into often. If this is the case, you can create aliasses to those directories to make cd
ing to them easier. For example, the following will alias the Dropbox folder:
alias db="cd ~/Dropbox"
allowing you to enter db
and change directories to ~/Dropbox
.