Skip to content

Instantly share code, notes, and snippets.

@pspeter3
Created July 24, 2012 18:15
Show Gist options
  • Save pspeter3/3171607 to your computer and use it in GitHub Desktop.
Save pspeter3/3171607 to your computer and use it in GitHub Desktop.
Quickly add aliases to your ~/.bashrc
function add-alias() {
echo "alias $1=\"${@:2:$#}\"" >> ~/.bashrc;
source ~/.bashrc;
}
@pspeter3
Copy link
Author

An example would be

add-alias list-all ls -a

which becomes

alias list-all="ls -a"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment