sudo vi command code example Example 1: linux vi Use Vim instead of Vi. Vim is easier to use. Example 2: take sudo access inside vim w !sudo tee %