Skip to content

Instantly share code, notes, and snippets.

@liorrozen
Last active May 3, 2017 08:14
Show Gist options
  • Save liorrozen/8344368 to your computer and use it in GitHub Desktop.
Save liorrozen/8344368 to your computer and use it in GitHub Desktop.
Alias "can-haz" to "sudo apt-get" allowing you to run commands like "can-haz apache2".
alias can-haz="sudo apt-get install"
# Autocomplete function
_can-haz() {
cur=`_get_cword`
COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) )
return 0
}
complete -F _can-haz can-haz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment