In this article, we will show you how to make use of the alias command through some useful examples. We’ll cover creating aliases, show you a few useful examples, and show you how to delete aliases as well.
If you are working on the command line a lot of the time, you may have noticed that most of the commands you use are extended commands with flags, or options, along with piping the output of commands into other programs.
Imagine that every time you needed to change directory, you would have to type “change-directory” instead of “cd” or if every time you needed to list the contents of a directory, you’d have to type “list” instead of “ls“. That’s why the makers of most commands attempt to eliminate the long names of the commands and replace them with shortened names. It reduces the amount of typing you have to do to get things done, and also makes the commands easier to remember as a bonus, thanks to the shorter name.
Basically, bash aliases are just shortcuts for the longer commands. The alias command allows us to run any command or even a group of commands (which includes options and filenames) by typing a custom phrase (which can even be just a single word) into the command line.