Bash Aliases to Make Your Life Easier

The BASH shell - Bourne Again SHell
I spend a lot of time working on the bash command line, and I’ve come to highly value the availability of my custom set of shortcuts, preferences, and tricks, right at my fingertips. You know, all the stuff that lives in .bashrc, .profile, .vimrc, .git, etc. I operate and develop across an array of servers, from my own to my clients, and it’s not always easy to reconfigure the same bash aliases every time I access a new server. As such, I decided to create a public list of the top aliases I use, and am making them available for anyone else to use as well.

Setup

There are a lot of various aliases and an infinite amount of variations possible. Because of this, we’re going to place our bash aliases in a separate file, that will exclusively contain aliases, called .bash_aliases. However, we need to be sure that the .bashrc file will load the file containing our aliases. To do this, simply open your .bashrc file in your preferred editor, and verify that the following code is in your file:
				
					if [ -e $HOME/.bash_aliases ]; then
    source $HOME/.bash_aliases
 fi
				
			
Now that you have confirmed that you can load your .bash_aliases file, let’s add the aliases to it! Here is the list of aliases that I use daily, and implement on all servers that I operate on:
Simply copy and paste the entire file into your .bash_aliases file, save, and exit, and you’re nearly ready to go! The final step is to refresh your bash environment by running source ~/.bashrc. Congratulations on installing new bash aliases for yourself, and enjoy experimenting with the shortcuts!
Share This :