As a developer there are actions I do over and over that can be quite repetitive in the CLI. Some of these commands require specific flags to be set or a long string of sources and destinations. I’ve found it easier to write aliases into my .bashrc file in order to mediate that.

The .bashrc file is in your home directory (~/ or /home/username/) and is an invisible file (starting with a ‘.’) that contains aliases and environmental variables for your bash session.

First, let’s open your .bashrc file:
$ vim ~/.bashrc

Once open, enter the following after the last entry.

Save and exit your bash session and restart terminal (or your bash session if you are running CLI only).

This entry allows you to simply type ‘..’ instead of ‘cd ..’ to backup one directory.

Some of the more common aliases I use are:

Post Promoter Pro

Posted by Chris Klosowski

Hi, I'm Chris Klosowski. Currently I am a Lead Developer of Easy Digital Downloads, where we build the easiest way to sell digital products with WordPress. I am also the person behind Post Promoter Pro, the most effective way to promote your WordPress Content.

Leave a reply

Your email address will not be published. Required fields are marked *