Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nortikin/6611e46783bd13c1f61e6abdb3c953a2 to your computer and use it in GitHub Desktop.
Save nortikin/6611e46783bd13c1f61e6abdb3c953a2 to your computer and use it in GitHub Desktop.
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