Linux Essentials - Bash Aliases

Originally published at: Linux Essentials – Bash Aliases – LearnLinuxTV

Aliases in Bash enable you to essentially create your own commands, or even just simplify existing ones. In this video, I’ll explain what aliases are, and I’ll show you some of my personal favorites. At the end, I’ll show you how to make your aliases persist between sessions.


I noticed that most distros I used have a bit in the .bashrc that sources ~/.bash_aliases (if it exists) for people to put their aliases in. I’ve been using that now, as it’s lots easier to copy that file to other systems where I might not want to just copy the whole .bashrc to it, especially if its for a different distro. :slight_smile:


I do the same thing(s) with functions. As with Aliases, you can just create a dot-file and source it when you log in with an IF statement. I also use this method for paths environment variables when using specific versions of Java, Spark, Scalla, and SBT.

1 Like