Linux common commands-4: cat

The cat command is used to view the content of plain text files, targeting files with less content. The viewing method of large files will be introduced later.

Syntax format: cat [parameter] [file]

Common parameters:

Example

 # 查看文件test.py的内容,并显示行号cat -n test.py

If there is no editor in the system, you can also use cat to edit the file

 # 如果是追加内容的话,使用>>,EOF是结束标记cat > test.py << EOF > import os > print('Hello Python.') > EOF

This article is reprinted from https://xugaoxiang.com/2022/06/01/linux-cmds-4-cat/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment