Home  >  Article  >  Operation and Maintenance  >  How to open text file in linux system

How to open text file in linux system

王林
王林Original
2020-01-11 10:05:4517021browse

How to open text file in linux system

Method 1: Use the Vim text editor

Enter [vi file name.txt] in the terminal program. The "vi" part of the command selects the "Vim" text editor to open and edit the file. Replace "filename" in the command with the target filename.

(Online learning video tutorial sharing: linux video tutorial)

For example: the file name is "tamins", please enter vi tamins.txt and press the Enter key.

How to open text file in linux system

#When closing the file, enter: q in the terminal and press the Enter key. This will exit the Vim program and return to the terminal main interface.

Method 2: Use the cat command

Open the terminal program and directly use the cat command to view the contents of the file sample. Just type [cat sample.txt] at the prompt and press Enter.

The function of the cat command is to display the entire file content starting from the first line.

As shown in the picture:

How to open text file in linux system

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of How to open text file in linux system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn