The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
 

cat: Reading Files



The cat command (short for concatenate) is used to read plain text files. It's similar to the "type" command in DOS. The basic usage is cat file, where "file" is the name of the file you want to read.

Example:
cat FILE ←Read the contents of a file
cat -n FILE ←Read the contents of a file with line numbers
cat FILE1 FILE2 > FILE3 ←Combine two text files (FILE1/FILE2) into one file (FILE3)

For more detailed options and parameters, you can refer to the provided link.

cat, when used in combination with redirection, can also serve as a simple text editing tool. For examples, you can refer to the provided link.