How does one define aliases for use within MobaXTerm *local* bash shell?

6

3

I have been using MobaXterm for the last couple of weeks in Windows and I love it.

However, I haven't quite figured out how to define my own aliases for use within the local bash shell. The obvious Google search doesn't seem to yield any results on this matter.

I have tried putting .profile and .bashrc files with my alias definitions in the same directory as the Mobaxterm executable but no dice. The same files are in my Windows 'home' directory, but they are not seen by Mobaxterm.

I have also noticed that there are lots of predefined aliases in the terminal already, but I haven't been able to determine where these are defined, so that I could add my own...

Mateo

Posted 2015-12-28T17:16:06.420

Reputation: 161

Answers

6

If you create the .bashrc file it will work.

Cd ~

touch .bashrc

chmod 755 .bashrc

Edit the file and add an alias

alias hello='echo hello world'

MC Jazz

Posted 2015-12-28T17:16:06.420

Reputation: 61

This is a good answer. However, I recently found out that, in order for this to be fully effective (for the bashrc to be permanent) one has to first configure a Persistent home directory throught Settings -> Configuration. – Mateo – 2016-01-06T16:18:05.573

0

in my experience with MobaXterm, .bash_profile is far more effective than .bashrc; This would likely still require a persistent home directory since you need to store the data somewhere.

If you have MobaXterm Professional you also get the MobaXterm_Customizer, I can't recall if this comes with the free version.

I believe you can set your alias's in the "Profile" tab of this program and then generate a portable executable if that was your wish.

r007ed

Posted 2015-12-28T17:16:06.420

Reputation: 166