how to save and quit the vi editor in linux code example Example 1: vi save and exit //Save :w //Exit :q Example 2: vim save and quit // Save & exit :wp