Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Alias to create aliases
# set aliases
. ~/.bash_aliases
new-alias() {
local last_command=$(echo `history |tail -n2 |head -n1` | sed 's/[0-9]* //')
echo alias $1="'""$last_command""'" >> ~/.bash_aliases
. ~/.bash_aliases
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment