Create permanent bash alias
Jagan Duraisamy
Performance Engineering & Observability Specialist | SRE | OpenTelemetry | AIOps | Automation
In our day-to-day work, we need to enter the same long commands frequently (and will always make typo mistakes :(). The #alias?command lets you create shortcuts for these commands, making them easier to remember and use.
But this alias command is also short-lived and valid for that particular session. How can we make it persistent?
Create ~/.bash_aliases file
Update ~/.bashrc file to load the aliases
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
To load it immediately, use the source command : source ~/.bash_aliases
To list all aliases
Use alias command to see the list.
Senior DevOps Engineer ? DevOps Advocate ? (Docker, Kubernetes, CI/CD Automation, Infrastructure as Code, Ansible, Scripting (Bash & Python), Cloud Platforms - AWS) ? Technical Writer ? Resume Writer ? SDG 4 Advocate??
4 个月Amazing One, This just helped me out