Save a file you edited in vim without the needed permissions

$ :w !sudo tee %

Many times I open a file with the intention of editing it, but then i realise that I do not have enough permisions, so this is the fix.

You must be logged in to post a comment.