From the course: LPIC-1 Exam 102 (Version 5.0) Cert Prep

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Bash aliases as shortcuts

Bash aliases as shortcuts

- [Instructor] An easy way to create a shortcut to a command is by using an alias. Shell aliases get executed before anything else, so you can override other commands with them. Let's take a look at the Bash execution order. First, Bash aliases are run and then Bash functions. And next, Bash built-in commands that are built into the Bash shell itself. And lastly, the commands on-disk. Now, let's take a look at the current aliases. In a terminal, type in alias and hit enter. From this, we can see we have an alias named ll. This explains why we can type in ll and it will do a long list with colors. Now, let's add our own alias. To do so, load your .bashrc file into vi by typing in vi ~/.bashrc and hit enter. Now, go into insert mode by pressing the I key and go to the bottom of the file. An alias creates a shortcut for any command string. To exemplify how to create an alias, we will create a simple one that will speed up…

Contents