Easily create new CLI aliases with `new-alias`

I love stuff like this: It’s a handy little alias to create aliases for commands you just ran … an β€œalias-generating alias”; my inner geek rejoices πŸ™‚ Here’s the code (add it to your .bash_profile): new-alias() { local last_command=$(echo `history |tail -n2 |head -n1` | sed ‘s/[0-9]* //’) echo alias $1=”‘””$last_command””‘” >> ~/.bash_profile . ~/.bash_profile […]