Forked from patricksanders/gist:7fdac24e58e42dc495758398fb59da08
Created
May 4, 2020 22:54
-
-
Save nortikin/6611e46783bd13c1f61e6abdb3c953a2 to your computer and use it in GitHub Desktop.
Alias to create aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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