Skip to content

Instantly share code, notes, and snippets.

@n00dl3
Created June 11, 2020 13:35
Show Gist options
  • Save n00dl3/d011008f283772609daa930023f01a35 to your computer and use it in GitHub Desktop.
Save n00dl3/d011008f283772609daa930023f01a35 to your computer and use it in GitHub Desktop.
:w !sudo tee %
# :w = Write a file.
# !sudo = Call shell sudo command.
# tee = The output of the vi/vim write command is redirected using tee.
# % = Triggers the use of the current filename.
# Simply put, the ‘tee’ command is run as sudo and follows the vi/vim command on the current filename given.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment