1. Enter the file
vim /etc/profile
2. Edit the file
press i to edit
3. Save and exit
1. First press the esc key to return to the command editing mode, and the Insert just now will disappear
2. According to English status:
3. At this time
:q! Do not save the file, force exit the vi command
:w save the file without exiting the vi command
:wq save the file and exit the vi command
4. Enter the above command and press enter