Problems encountered when saving a file after creating a new file in vi: E212: Unable to open and write the file

Problem Description

The following problems are encountered when saving and exiting after using the vi editor to write the content

 

solution

The reason for this problem is that the user permissions are not enough, because ordinary users cannot save files with vi, and they need to use super users.

Convert to superuser first: su

Then use vi to open the file to save: vi...:wq

 

Reference link

Linux operation prompt: "Can't open file for writing" or "operation not permitted" solution

The problem encountered when vi creates a new file and saves the file: E212: Can't open file for writing

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325184211&siteId=291194637