e.g you regularly type:
ls -la
you can turn it into an alias just by typing
ali #nameOfAlias #command
ali l ls -la
Which is more convenient than the regular alias. To get the ali function modify your .bashrc file in your home directory (if it doesn't exist on linux mint just create it and it will be used automatically)
function ali() {
echo "alias $1='${@:2}'" >> ~/.bashrc
#in ubuntu use ~/.bash_aliases
echo "made alias:";
echo "alias $1='${@:2}'";
source ~/.bashrc; #reload bashrc
}
this appends the new alias to .bashrc and it will be available immediately and permanently.

Keine Kommentare:
Kommentar veröffentlichen