How to add an alias on linux

Alias I want to add: is hss=“hugo server -D –noHTTPCache”, you may want to do a different one as this one may not work for you (even for testing), the one I initially used for testing was myip=“curl ifconfig.me”. but there are better ones since ifconfig.me may be down in the future.

Step 1: Make a copy of the .bashrc file

cp ~/.bashrc ~/.bashrc-copy

Step 2: Add the following line at the bottom of your .bashrc file:

nano ~/.bashrc
alias hss="hugo server -D --noHTTPCache"

Step 3: Test if it works

. ~./bashrc
hss

Congratulations if it worked. :)

If it didn’t work, restore the .bashrc file like this:

mv ~/.bashrc-backup ~/.bashrc
. ~/.bashrc

Then if you want to try again you can go back to step 1.