How to open text file in linux system

王林
Release: 2020-01-11 10:05:45
Original
17013 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template