

If then test -r ~/.dircolors & eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls -color=auto' #alias dir='dir -color=auto' #alias vdir='vdir -color=auto'Īlias grep='grep -color=auto' alias fgrep='fgrep -color=auto' alias egrep='egrep -color=auto' # enable color support of ls and also add handy aliases bashrc file where it comes with some predefined aliases. Look out for the alias section under the. But I will not prefer this and I choose to stick with grouping all my alias under. You can also create a custom alias file under any directory and add definition in either. # See /usr/share/doc/bash-doc/examples in the bash-doc package. # ~/.bash_aliases, instead of adding them here directly. # You may want to put all your additions into a separate file like


bash_aliases is present under the user home directory and load it whenever you initiate a new terminal session.
BEST BASH ALIAS SETUP FOR MAC CODE
This section of code is responsible for checking if file. bashrc file and look out for the following section. $ touch ~/.bash_aliases # Create empty alias file bash_aliases # Check if file is available bash_aliases will not be available and we have to create it. bash_aliases file is to group all your aliases into a separate file instead of putting it in the. User-level aliases can be defined either in the. Invoke your shell and simply type “ alias” to see the list of defined alias. An alias can be set either at the “ user-level” or “ system level”. Check Bash Aliases in LinuxĪlias is a shell builtin command and you can confirm it by running: $ type -a aliasīefore jumping and setting up an alias we will see the configuration files involved. Over the course of this article, we are going to see how powerful is an alias and the different ways to set up an alias and use it. Alias is very helpful when our command is very long and for frequently used commands. Alias in bash can be termed simply as a command or a shortcut that will run another command/program.
