.bashrc: My Config

This is going to be a long one... So much is (or can be) involved with a .bashrc file from the moment you open your terminal. My .bashrc has evolved from the basic default to a fairly complex file in which each line has a very specific purpose. I will break down each line and explain the reasoning, and what it does for me.


Since you (yeah you!) might be a seasoned Bashmaster or a Bashnewbee, I am going to break things down for the later. I was a Bashnewbee not too long ago and I still remember as I was learning, missing context that was assumed I had by the content provider (whether that was from a blog post or a YouTube video).


The .bashrc file


Location


absolute path: /home/{YOUR USER NAME}/.bashrc

relative path: ~/.bashrc


Hidden


Since .bashrc begins with a period ., it is hidden from most 'default' views. For example, when you list files in a folder with the ls command, the 'default' view of the listed files excludes hidden files such as your .bashrc file. To see the hidden files you must add an optional flag (-a) to the ls command.

Here is the very first purpose of your .bashrc file! Since, most of the time, when you want to view a list of files in a folder you want to see ALL of the files; you can make that happen in your .bashrc with an "alias".


#!/bin/bash

alias ls='ls -a'

← back to posts