Fetching your aliases...

*nix aliases

We all know how aliases on the *nix system help to create short commands for the long ones. E.g. kga can stand for kubectl get all or gl for git log --name-status --decorate. Software associates create such aliases and write them in the ~/.bashrc file. So aliases are available whenever they logged in to their machine.

Challenge

However, associates also need to log in to other *nix machines for various purposes. Say a developer needs to log in to the SV system for live troubleshooting of an issue. Or a DevOps Engineer requires to log in to various cloud VMs for different purposes. One has become very used to the alias s/he has created. It's very difficult to copy/paste the aliases every time s/he logs in to the machine.

Solution

Here is one way to address this challenge. Create your aliases, categorize and put them in different files. Say General Aliases, Git Aliases, Docker Aliases, etc. Then create a setaliases.sh file. Download it on your machine.

wget https://raw.githubusercontent.com/simplyatul/bin/master/setaliases.sh

and then source it

source setaliases.sh

That's it. All your aliases are set.

If you are frequently logging in to a particular machine, then just copy the above source command in the ~/.bashrc file.

I am sure there are many other ways to address this challenge. And I am curious to learn how you do this differently. Please comment.