How to create an Alias with a Variable inside?
You can't use alias for arbitrary substitutions. You can use a function instead.
function gre() {
grep -r "$@" .
}
You can add the line to ~/.bash_profile
alias gre='grep -rwn'
and use it just adding dot after search string
gre 'search string' .
to update your current session in case you do not want to close the tab
source ~/.bash_profile
which in turn your can alias as well if you like adding new aliases from time to time. sbash
for example.