cat
Quick Reference
Command Name:
cat
Category:
file management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
Display file contents
Quickly view small text files in the terminal
- 2
Concatenate files
Combine multiple text files into a single file
- 3
Create new files
Create small text files directly from the terminal
- 4
Append to files
Add content to the end of existing files
Syntax
cat [OPTION]... [FILE]...
Options
Option | Description |
---|---|
-n |
Number all output lines |
-b |
Number non-empty output lines |
-A |
Show all non-printable characters |
-s |
Suppress repeated empty output lines |
-T |
Display tab characters as ^I |
-v |
Show non-printing characters using ^ and M- notation |
Examples
How to Use These Examples
The examples below show common ways to use the cat
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
cat filename.txt
cat file1.txt file2.txt
cat -n filename.txt