.bashrc is a shell file placed in the user home directory, and sourced while you start an interactive shell in Linux terminals, such as local MobaXterm or in Cygwin. This file can be edited or created to customize bash behavior, for example, define ENV settings, aliases, functions, call scripts, etc.

How to configure local terminal bashrc in MobaXterm?


Let us have a look at how to configure the bashrc file in your local mobaxterm.

Step #1: Open your local bash terminal


#1. Open your MobaXterm
#2. From Terminal Menu, "Open New TAB"
#3. Click Start Local Terminal - Your terminal window will open

You would get a window something like below with a banner message,
Code:
[20XX-XX-XX 10:24.13]  ~
[admin.Devopsrun] >
Edit .bashrc file, using the command vim .bashrc
You can customize your settings there.

Step #2: Open or create the file .bashrc


Edit .bashrc file, using the command vim .bashrc
You can customize your settings there.

Step #3: Example customization


Let us enter a simple alias,
Code:
[admin.Devopsrun] >vim .bashrc
alias hello="echo hello world"

Step #4: Reloading the bashrc changes to the shell


It is required that you have to reload the .bashrc file in order to make the changes available in your current shell. (Note, the changes will be available all the time when you open a new terminal/shell).
To reload .bashrc, use any one of the following method,
Code:
. .bashrc
or
Code:
source .bashrc

Step #5: Testing your new bashrc


Code:
[admin.Devopsrun] >hello
hello world

Another example for creating a bashrc function can be found here: SSH username alias