Skip to content

Instantly share code, notes, and snippets.

@mhaulo
Created September 4, 2016 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhaulo/cb52d5498f8ccfa58925031a3ed06c88 to your computer and use it in GitHub Desktop.
Save mhaulo/cb52d5498f8ccfa58925031a3ed06c88 to your computer and use it in GitHub Desktop.
fuck! : bash alias to repeat last command using sudo
# Add the following line to .bashrc
#
# Usage:
# $ mkdir /some/dir/foo
# mkdir: cannot create directory ‘/some/dir/foo’: Permission denied
# $ fuck!
# [sudo] password for username:
#
alias fuck!='sudo $(history -p !!)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment