:wq! file linux vim sudo root well code example Example 1: vim sudo write :w !sudo tee % Example 2: take sudo access inside vim w !sudo tee %