Linux Aliases
Mahmoud C.
IT Engineer @ Auranik Technologies Limited | CompTIA Security+, Linux, Aspiring Devops Engineer
An alias serves as a convenient shortcut for frequently used commands, enhancing user efficiency while minimizing the chances of human errors and repetitive typing.
To create an alias, you have the option of either establishing a file named .bash_aliases or directly incorporating the alias into .bashrc. It's essential to note that an alias won't take effect in your current shell session until the corresponding file is executed. This is where the 'source' command, sometimes represented as '.', plays a pivotal role.
For instance, consider an alias I've integrated into my daily workflow: 'alias bnmap='sudo nmap -sC -sV -vv' followed by the target machine's IP address. If necessary, you can append additional flags, resulting in a command like 'bnmap 10.10.10.10 -oN file'.
To determine the definition of an alias, you have two options: employ the 'alias' command followed by the alias name or simply navigate to the alias file to inspect the associated command.