I know I can create an alias for untar like this
alias untar=’tar -xvzf’
How do I make this persist from session to session, because it seems it is lost when I reconnect?
Answer
As already stated, ~/.bashrc is where you want to place them. You may like this little function I use to create aliases (place it in your ~/.bashrc file).
function mkalias ()
{
if [[ $1 && $2 ]]
then
echo -e "alias $1=\"$2\"" >> ~/.bashrc
alias $1="$2"
fi
}
The basic syntax is: mkalias
an example would be: mkalias trsh "mv --target-directory=$HOME/.Trash"
the command is always placed in quotes in case there are spaces.
No comments:
Post a Comment