If you’ve ever found yourself typing out the same long commands over and over again, or if you’ve ever wished you could teleport directly to your favourite directories, then this post is for you.
Before we jump into some useful examples, let’s go over what bash functions and aliases are, and how to set them up.
Bash Functions vs Aliases
A bash function is like a mini script stored in your .bashrc
or .bash_profile
file. It can accept arguments, execute a series of commands, and even return a value.