Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to open a file and save it in linux

Shulou Source: shulou.com Published: 2022-06-03 06:26:39 09月13日 Update

How to open a file and save it in linux? I believe that many novice rookies are ignorant of the knowledge that linux opens files and saves. Through the summary of this article, I hope you can gain more. The following information is about? The content of.

For example, to modify the host file

First use the vi / etc/hosts command to open the read mode of the hosts file, press o to enter edit mode, and insert a line after the current location.

After entering the content, press ESC to exit edit mode and enter reading mode.

Command: W save file

Command: Q exit.

Recommended video learning tutorials: linux video tutorials

Edit mode commands:

I: insert at current location

A: append after the current location

O: insert a row after the current location

I: insert in the header

A: append at the end of the line

O: insert a row in front of the current location

Read mode command:

W save the file

W filename is saved as a filename file

Q exit

: q! Forcibly withdraw

: w! Forced writing

Wq save exit

X same as wq

The above is how to open a file and save the knowledge summary in linux, the content is more comprehensive, the editor believes that there may be some knowledge points that we may see or use in our daily work. I hope you can learn more from this article.

Tags: Files patterns locations commands knowledge one line content tutorials more articles videos in-line study tutorials that is novice daily work for example status knowledge points wardrobe Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker MySQL Shulou Tech Info Shulou Technology vpn