Linux - create bash alias in external file

1111111111Rating 0.00 (0 Votes)
Bash aliase very useful, I create external file in home folder ~/.bash_aliases and save all alises in this file. For example, create new file in ~/:
nano ~/.bash_aliases
Add new alias in the file:
alias hn="hostname"
Include file in ~/.bashrc file:

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

Refresh enviorment:
. ~/.bashrc
Test new alias - enter new comand hn in terminal ))

Add comment


Refresh
Security code

Вверх
Вниз