how to open linux file

尚
Original
2019-12-17 13:28:414603browse

how to open linux file

Method 1 (using Vim text editor):

1. Open the terminal. Click on the menu and find the Terminal program. The program's icon is a black box with a white ">_" on it. click it. The "Terminal" program can generally be found in the left column of the menu window.

how to open linux file

#2. Enter vi filename.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.

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

how to open linux file

Method 2 (using Emacs editor):

1. Enter emacs file name.txt in the terminal program. Here, the specific name of the text file is used instead of the "file name" in the command.

how to open linux file

#2. Press the Enter key. If the entered file name exists, the command will open the existing file. If there is no file with the same name in the current path, this command can open a new text file in the Emacs editor.

For example, enter the emacs bbb.txt command to open the text file named "bbb".

3. Press Ctrl X when exiting, then press Ctrl C to exit the Emacs text editor and return to the path of the terminal.

how to open linux file

Method 3:

1. 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.

how to open linux file

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of how to open linux file. 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