Get the App
SLTechnology News&Howtos  ›  Servers  › 

What are the commands for linux to open a file?

Shulou Source: shulou.com Published: 2022-06-02 04:38:15 10月17日 Update

This article mainly introduces what the linux command to open the file is, the article is very detailed, has a certain reference value, interested friends must read it!

Linux open file commands are: 1, cat command, used to view the contents of the file; 2, tac command, from the last line to display; 3, nl command, output line number when displayed; 4, more command, used to display the contents of the file page by page, and so on.

After opening the terminal program, 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 full contents of the file starting from the first line.

Under the Linux system, there are many commands that can view the contents of a text file, such as commands such as cat/tac/nl/more/less/head/tail. In addition to the functions of the above cat commands:

1 tac tac: starting from the last line, you can see that the alphabetical order of tac is opposite to that of cat

2dint NL: output the line number when displayed.

3 more: display the contents of a file page by page

4 less is similar to more, but it can turn the page forward

5 focus head: just look at the first few lines

6pm tail: just look at the last few lines

7maginod: reads files in a binary way.

The above are all the contents of the linux command to open the file, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Commands files content one line function time line number output binary value interest just letters boys buddies prompts text ways are made by more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft vpn Shulou Information macOS Shulou Tech Info