Working of an Alias
The alias keyword replaces the command with the string which might be sets of commands or functions. The alias is defined in the ~/.bashrc or ~/.bash_profile. These files are loaded in the shell environment and thus the commands listed in the alias are also been loaded and ready to be executed. Thus, the alias work with the BASH configuration.
After the aliases or command maps have been loaded, the user can interact and enter the commands. If the command in the alias is executed the BASH interpreter replaces the command alias with the string of commands and hence the desired functioning of the alias or command is achieved.
We’ll see how to create a BASH Alias in the next section.
Bash Scripting – Working of Alias
BASH Alias is a shortcut to run commands using some mapping. It is a way to create some shortcut commands for repetitive and multiple tasks. We create an alias in a BASH environment in specified files. We can also incorporate BASH functions, variables, etc to make the Alias more programmatic and flexible.