Where Is The Alias File In Linux?

The Linux alias is used to create shortcuts or short forms for the commands. The alias makes a command with options easy to call without remembering all details. Aliases are created using the alias keyword but where is the alias file or alias file configuration?

Alias File In Bash Shell

The alias commands in bash are stored inside the bash configuration file. The bash configuration file is located ~/.bashrc .

$ vim ~/.bashrc

Alias File In ZSH Shell

The alias file in ZSH shell is located in the ~/.zsh .

$ vim ~/.zshrc

Alias File In CSH Shell

The alias configuration is stored in ~/.csh for the CSH shell.

$ vim ~/.csh

Alias File In Korn Shell

The alias configuration is stored in ~/.ksh for the CSH shell.

$ vim ~/.ksh

Adding Alias To Alias Files

Open the alias files according to your shell type and add the alias. In the following example, we add an alias named mycd which simply changes the current working directory into the /mnt .

alias mycd="cd /mnt"
See also  What Does "set -e" In Bash?

Leave a Comment