Skip to content

Instantly share code, notes, and snippets.

@dfinzer
Created April 30, 2016 21:35
Show Gist options
  • Save dfinzer/8059ce0b43c476fcb986e8b3096aeafd to your computer and use it in GitHub Desktop.
Save dfinzer/8059ce0b43c476fcb986e8b3096aeafd to your computer and use it in GitHub Desktop.
Command for creating new aliases from the previous command
new-alias() {
local last_command=$(echo `history |tail -n2 |head -n1` | sed 's/[0-9]* //')
echo alias $1="'""$last_command""'" >> ~/.bash_profile
. ~/.bash_profile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment