My colleague gave me a file containing lots of configs such as
alias ll="ls -l"
alias lr="ls -lrt"
alias gv="vim -g"
How can I use(execute) this profile?
You can load the profile using source command:
source <profile-filename>
eg:
source ~/.bash_profile
For your custom aliases, the best place should be at ~/.bash_aliases. You must just be sure the ~/.bashrc file already contains the following lines:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
or in a more concise manner:
[ -f ~/.bash_aliases ] && . ~/.bash_aliases
To load them immediately, source it. Otherwise, aliases will be loaded at every terminal opening. To check, use the alias command without argument.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With